Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

protocol.txt 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ZEO Network Protocol (sans authentication)
  2. ==========================================
  3. This document describes the ZEO network protocol. It assumes that the
  4. optional authentication protocol isn't used. At the lowest
  5. level, the protocol consists of sized messages. All communication
  6. between the client and server consists of sized messages. A sized
  7. message consists of a 4-byte unsigned big-endian content length,
  8. followed by the content. There are two subprotocols, for protocol
  9. negotiation, and for normal operation. The normal operation protocol
  10. is a basic RPC protocol.
  11. In the protocol negotiation phase, the server sends a protocol
  12. identifier to the client. The client chooses a protocol to use to the
  13. server. The client or the server can fail if it doesn't like the
  14. protocol string sent by the other party. After sending their protocol
  15. strings, the client and server switch to RPC mode.
  16. The RPC protocol uses messages that are pickled tuples consisting of:
  17. message_id
  18. The message id is used to match replies with requests, allowing
  19. multiple outstanding synchronous requests.
  20. async_flag
  21. An integer 0 for a regular (2-way) request and 1 for a one-way
  22. request. Two-way requests have a reply. One way requests don't.
  23. ZRS tries to use as many one-way requests as possible to avoid
  24. network round trips.
  25. name
  26. The name of a method to call. If this is the special string
  27. ".reply", then the message is interpreted as a return from a
  28. synchronous call.
  29. args
  30. A tuple of positional arguments or returned values.
  31. After making a connection and negotiating the protocol, the following
  32. interactions occur:
  33. - The client requests the authentication protocol by calling
  34. getAuthProtocol. For this discussion, we'll assume the server
  35. returns None. Note that if the server doesn't require
  36. authentication, this step is optional.
  37. - The client calls register passing a storage identifier and a
  38. read-only flag. The server doesn't return a value, but it may raise
  39. an exception either if the storage doesn't exist, or if the
  40. storage is readonly and the read-only flag passed by the client is
  41. false.
  42. At this point, the client and server send each other messages as
  43. needed. The client may make regular or one-way calls to the
  44. server. The server sends replies and one-way calls to the client.