mnStartBroadcast

This initializes an instance to broadcast state and enables the receiving and/or sending of broadcast packets.

Broadcast packets use UDP and so have the same characteristics as normal UDP packets. Only UDP commands are applicable in broadcast state.

A broadcast packet will be sent to the port specified by the ‘Broadcast_port_to_connect_to’ parameter using the local IP specified by mnSetLocal (UDP parameter) to all computers on that LAN. mnSendUDP should be used to send broadcast packets and the client ID and operation ID parameters should be ignored.

mnSetLocal should be used before this command to set the local port to receive broadcast packets on. mnRecvUDP should be used to receive broadcast packets on the port specified by mnSetLocal. Broadcast packets are received using UDP mode UM_CATCH_ALL.

Broadcast ports are not exclusive which means that multiple applications can listen on the same port at the same time.

Parameters

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

unsigned short Broadcast_port_to_connect_to: This is the port that packets will be sent to if sending is enabled.

bool Send_enabled: If this is false then sending will not be possible.

bool Receive_enabled: If this is false then receiving will not be possible.

Returns (Integer)

0 if no error occurred.

-1 if an error occurred.

Present in

DBP

C++

.Net




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