mnSendUDPAll

This is used in server state (mnStartServer) to send the specified packet via UDP to all connected clients.

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

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.

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 to all currently connected clients. If this parameter is false the command will return immediately and if the packet has not yet been sent it will be sent later.

int Client_exclude: This specifies a client to exclude from the send operation. Use this to send to all clients except one. If you want to send to all clients without excluding one, set this parameter to 0.

Returns (Integer)

0 if all packets were sent or will be sent successfully

-1 if an error occurred when trying to send to any of the currently connected clients.

Clients are automatically dropped if an error occurs. This is done using mnDisconnectClient.

Present in

DBP

C++

.Net




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