Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

tcp/udp multicast/broadcast

Name: Anonymous 2007-10-11 22:41

I'm making a game that requires the connection of two or more players. at the moment if two people are on a LAN or internet they have to specify their addresses explicitly.

I want to know how to broadcast if a player is available on a network, so the user can just click the game name. I thought there where broadcast address for UDP (like 255.255.255.255 or something)

help?

Name: Anonymous 2007-10-11 22:55

Network IP + append 255.  ie xxx.xxx.xxx.255

Name: Anonymous 2007-10-11 23:26

>>2
I think that depends on the subnet mask, doesn't it?

Name: Anonymous 2007-10-12 1:36

>>2
ah, I've done it, thanks alot =D

Name: Anonymous 2007-10-12 4:55

>>3
it does
read the rfcs or at least wikipedia

Name: Anonymous 2007-10-12 6:02

>>4
How'd you do it then?

Name: Anonymous 2007-10-12 23:20

>>6
255.255.255.255

Name: Anonymous 2007-10-13 13:42

>>7
Because you can broadcast to the entire internet, right? Usually neither multicast nor broadcast packets are routed beyond the local subnet.

>>1
Broadcast and multicast is available at layer 3 (IP) or layer 2 (ethernet or 802.11), not layer 4 (tcp/udp).

BroadcastAddress = (HostIP | (~ SubnetMask));

>>6
A host when searching for a game should broadcast a packet saying 'if you're a game server, please respond'.  Game server on receiving said packet should respond with a packet that contains all details required to establish a connection.  This service requires UDP rather than TCP.  In fact, all gaming should work through UDP, with fault tolerance provided by the application.  Otherwise you get long lags in the event of packet loss, window scaling etc.

Name: Anonymous 2007-10-16 0:14

>>8
I only wanted it to broadcast to the local network. In order to connect to other players on the internet I'd resolve a dns then connect to that server

UDP is best for FPS and games that require reaction. TCP is best for games like a rts (what I'm developing)

Name: Anonymous 2009-03-02 13:41

µ

Name: Anonymous 2011-02-04 16:29


Don't change these.
Name: Email:
Entire Thread Thread List