UDP Broadcast

BlitzMax Forums/BlitzMax Programming/UDP Broadcast

René(Posted 2006) [#1]
I had a look at GNet, TNet, BNet and ENet to get an idea of how to manage UDP broadcasts. Afaik is a broadcast the only way to create a list of "local" game servers.

Has someone managed a UDP broadcast or did someone find another way to create a list of local game servers?

I know you have to set the socket to broadcast mode, but the public commands of all the network modules mentioned above does not support such an option (correct me if I'm wrong).

In standard C you would use setsockopt() to change some options of the socket. I found a part in Pub.Stdc that use the setsockopt() function. Maybe this is a base to start from. But I don't know how.

Hope someone can help...thanks a lot!


King Dave(Posted 2006) [#2]
I don't know how it might work in Max, but in Blitz3D you could send the message to .255 (255 is reserved for broadcasting messages), so 192.168.2.255 would send to 192.168.2.0 through to 192.168.2.254


René(Posted 2006) [#3]
wew, this sounds not too hard. I will give it a try.
Thank you King Dave.