[Gambas-user] UDP Broadcast

Rob Kudla sourceforge-raindog2 at ...94...
Wed May 17 07:56:05 CEST 2006


On Wed May 17 2006 00:54, Michi wrote:
> The seond issue is about UDP broadcast and different...
> That one still does not work...

A bit of googling tells me that C programs need to set the 
SO_BROADCAST socket option (with setsockopt) before trying to 
send a broadcast packet, and SO_BROADCAST doesn't appear 
anywhere within the gb.net source code.  The symptom when the 
flag is missing would be an access denied error.

So I'm guessing gb.net just doesn't support sending broadcasts at 
present, but shouldn't be too hard to patch (the least elegant 
way would be to check if the last octet of the IP address is 255 
and set SO_BROADCAST accordingly, which would make it work for 
any netmask of 24 bits or smaller, if you didn't want to add a 
new "Broadcast" property for the user to set.)

In the meantime, you should be able to do broadcasts using some 
rather tortured API calls in the development releases.

Rob




More information about the User mailing list