mnSendUDP

This is used to send the specified packet via UDP.

Performance note: blocking send operations perform better than non blocking operations. Most noticeable performance differences occur when sending large packets or when sending a large number of packets.

In UDP mode UM_PER_CLIENT and UM_PER_CLIENT_PER_OPERATION packets must be formatted in a specific way, see “Unreliable (UDP)” for more information on UDP modes.

Parameters

int Instance: This is the instance that the command should use.

long long int Packet: This is the packet that the command should use.

int ClientID: This is the client ID of the client to send to. This can be ignored in client and broadcast state and can be set to anything.

bool Keep_packet: This specifies whether or not the specified packet should be cleared after it is sent (false) or if it should be left unchanged (true).

bool Block_until_sent: If this parameter is true the command will block until the packet has been sent. If this parameter is false the command will return immediately and if the packet has not yet been sent it will be sent later.

Returns (Integer)

0 if the packet was sent successfully straight away.

1 if the packet has not been sent but will be sent later.

-1 if an error occurred. In server state (mnStartServer) clients are automatically dropped and in client state (mnConnect) the client automatically disconnects if an error occurs. This is done using mnDisconnectClient.

Present in

DBP

C++




This page is in the following sections:
(2) Networking Commands
(1) Networking
(0) DarkNet Help