cf_client_send¶
Category: net
GitHub: cute_networking.h
Sends a packet to the server.
Parameters | Description |
---|---|
client | The client. |
packet | The packet. |
size | The size of packet in bytes. |
send_reliably | If true the packet will be sent reliably and in order. If false, the packet will be sent just once, and it |
may arrive out of order, or not at all. |
Return Value¶
Returns any errors as a CF_Result.
Remarks¶
If the packet size is too large (over 1k bytes) it will be split up and sent in smaller chunks.
send_reliably
as true means the packet will be sent reliably an in-order relative to other
reliable packets. Under packet loss the packet will continually be sent until an acknowledgement
from the server is received. False means to send a typical UDP packet, with no special mechanisms
regarding packet loss.
Reliable packets are significantly more expensive than unreliable packets, so try to send any data that can be lost due to packet loss as an unreliable packet. Of course, some packets are required to be sent, and so reliable is appropriate. As an optimization some kinds of data, such as frequent transform updates, can be sent unreliably.