Skip to content

cf_client_pop_msg

Category: net
GitHub: cute_networking.h


Pops the next message received from the server, if any.

bool cf_client_pop_msg(CF_Client* client, uint32_t* id, void** data, int* size);
Parameters Description
client The client.
id The message's user id.
data Pointer to the message bytes. Free it with cf_client_free_msg.
size Size of data in bytes.

Return Value

Returns true when a message was popped.

Remarks

Incoming messages surface here as cf_client_pop_packet drains arriving packets, so keep popping packets each update like normal (even if you only ever use messages).

cf_client_free_msg
cf_server_send_msg
cf_client_send_msg