NetworkMgr::SendConnectionlessPacket
Defined in:
Sends an unreliable data packet to another machine without establishing a connection.
C4Network.h
NOTE. This is a low-level function that is normally called exclusively by the Message Manager. Calling this function directly is not recommended if the Message Manager is being used.
Prototype
NetworkResult SendConnectionlessPacket(const NetworkAddress& to, uint32 size, const void *data);
Parameters
to |
The destination address. |
size |
The size of the data packet. This value may not exceed the maximum size given by the constant kMaxMessageSize .
|
data |
A pointer to the data to be sent. |
Description
The SendConnectionlessPacket
function sends an unreliable data packet to the machine whose address is given by the to
parameter. It is not necessary to establish a connection with the destination machine in order to send packets using SendConnectionlessPacket
. The return value is one of the following network result codes.
kNetworkOkay |
The packet was successfully queued for transmission. |
kNetworkPacketTooLarge |
The packet could not be sent because its size exceeds kMaxMessageSize .
|
kNetworkBufferFull |
The packet could not be sent because the outgoing packet buffers are full. Try sending the packet again at a later time. |
Packet data is encrypted before it is transmitted.
See Also
NetworkMgr::SendReliablePacket
NetworkMgr::SendUnreliablePacket