ipc-high.txt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. The IPC protocol
  2. ================
  3. While the cc-protocol.txt describes the low-level primitives, here we
  4. describe how the whole IPC should work and how to use it.
  5. Assumptions
  6. -----------
  7. We assume the low-level protocol keeps ordering of messages. That is,
  8. if A sends messages 1 and 2 to B, they get delivered in the same order
  9. as they were sent. However, if A sends message 1 to B and 2 to C, the
  10. order in which get them or the order in which they answer is not
  11. defined.
  12. We also assume that the delivery is reliable. If B gets a message from
  13. A, it can be sure that all previous messages were delivered too. If A
  14. sends a message to B, B either gets the message or either A or B is
  15. disconnected during the attempt.
  16. Also, we expect the messages don't get damaged or modified on their
  17. way.
  18. Addressing
  19. ----------
  20. We can specify the recipient in two different ways:
  21. * Directly. Each connected client has an unique address. A message
  22. addressed to that addressed is sent only to the one client.
  23. * By a group. A client might subscribe to any number of groups.
  24. When a message is sent to the group, all clients subscribed to the
  25. group receive it. It is legal to send to an empty group.
  26. Feedback from the IPC system
  27. ----------------------------
  28. The IPC system generates some additional information to aid the
  29. communicating clients.
  30. Undeliverable notification::
  31. If the client requests it (by a per-message flag) and the set of
  32. recipients specified is empty (either because the connection
  33. ID/lname is not connected or because the addressed group is empty),
  34. an answer message is sent from the MSGQ daemon to notify it about
  35. the situation.
  36. Notifications about connections and disconnections::
  37. The system generates notification about following events:
  38. * Client with given lname connected
  39. * Client with given lname disconnected
  40. * Client with given lname subscribed to given group
  41. * Client with given lname unsubscribed from given group