C4 Engine
C4 Engine API Documentation

NetworkMgr::SendConnectionlessPacket

Defined in:  C4Network.h
Sends an unreliable data packet to another machine without establishing a connection.
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.
Delivery of a connectionless packet is not guaranteed, and connectionless packets may be received in an order different from which they were sent.

Packet data is encrypted before it is transmitted.
See Also

NetworkAddress

NetworkMgr::SendReliablePacket

NetworkMgr::SendUnreliablePacket

NetworkMgr::SendUnorderedPacket

NetworkMgr::BroadcastPacket

NetworkMgr::ReceivePacket