[Gambas-user] UDPSocket.Broadcast property ...

Benoît Minisini g4mba5 at gmail.com
Thu Sep 3 10:17:35 CEST 2020


Le 03/09/2020 à 10:00, Hans Lehmann a écrit :
> Hello,
> 
> I have problems understanding the UDPSocket.Broadcast property. In the
> net I found "UDP broadcasts can be used to allow client and server to
> find each other in a subnet without first knowing which hosts they are
> running on. For this purpose the server opens a socket that listens on a
> certain port. The client can then send a UDP broadcast on this port to
> all hosts in the subnet, to which the server can respond. "
> 
> Now the exciting question: How do I implement this approach in Gambas
> with a UDP client?
> 
> With kind regards
> 
> Hans
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 

That property sets or clears the socket broadcast flag.

The manpage says:

« SO_BROADCAST

Set or get the broadcast flag.  When enabled, datagram sockets are 
allowed to send packets to a broadcast address.  This option has no 
effect on stream-oriented sockets. »

Regards,

-- 
Benoît Minisini


More information about the User mailing list