Extract the id from a c2c message.
- Parameters
-
msg | The client-to-client message. |
- Returns
- The id upon success, -1 upon failure. Extract the sender id from a c2c message.
- Parameters
-
msg | The client-to-client message. |
- Returns
- The sender id upon success, -1 upon failure. Extract the destination id from a c2c message.
- Parameters
-
msg | The client-to-client-message. |
- Returns
- The destination id upon success, -1 upon failure. Extract the payload from a c2c message.
- Parameters
-
msg | The client-to-client message. |
- Returns
- The payload upon success, NULL upon failure. Format a client-to-client message.
Messages are dictionaries of the form:
"sender" : id of the sender client
"destination" : id of the destination client
"id" : 0 if the message doesn't expect reply, else a message id
"payload" : the contents of the message
- Parameters
-
sender | the id of the sender client |
dest | the id of the destination client |
id | the id of the message |
payload | the contents of the message |
- Returns
- the formatted message
- Note
- Increases the refcount of payload.