ISteamNetworkingSockets.ReceiveMessagesOnConnection

Fetch the next available message(s) from the connection, if any. Returns the number of messages returned into your array, up to nMaxMessages. If the connection handle is invalid, -1 is returned.

The order of the messages returned in the array is relevant. Reliable messages will be received in the order they were sent (and with the same sizes --- see SendMessageToConnection for on this subtle difference from a stream socket).

Unreliable messages may be dropped, or delivered out of order with respect to each other or with respect to reliable messages. The same unreliable message may be received multiple times.

If any messages are returned, you MUST call SteamNetworkingMessage_t::Release() on each of them free up resources after you are done. It is safe to keep the object alive for a little while (put it into some queue, etc), and you may call Release() from any thread.

class ISteamNetworkingSockets
int
ReceiveMessagesOnConnection

Meta