Server Discovery
Server Discovery
You all know this when u power up a network game u just have to hit a button and it searches for all the games running and displays them.
I tried to write my own network class. It works i can connect to other computers set up a server and send data and process it. But i dunno how to send a message to the whole network so i could send my server data back.
Any ideas?
Oh ofcourse i didn't write the network code...lol...would probably take me forever my class is a wrapper for enet which makes it really simple.
I tried to write my own network class. It works i can connect to other computers set up a server and send data and process it. But i dunno how to send a message to the whole network so i could send my server data back.
Any ideas?
Oh ofcourse i didn't write the network code...lol...would probably take me forever my class is a wrapper for enet which makes it really simple.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Many games use a public listing server for maintaining a list of active game sessions. When a host starts a session, it registers with the server. When a client wants a list of sessions, it connects to the listing server and requests a list of the registered servers.
You could also use socket multicasting or broadcasting to request a list of servers. I wouldn't recommend it, but it is something that you could do. Most likely the network library you are using won't support multicast or broadcast anyway, so that might stick you with doing a list server type implementation.
Travis
You could also use socket multicasting or broadcasting to request a list of servers. I wouldn't recommend it, but it is something that you could do. Most likely the network library you are using won't support multicast or broadcast anyway, so that might stick you with doing a list server type implementation.
Travis
Thanks vitek but already knew that....probably you got me wrong. I wanted to know how to do it on a private network and not internet. Because automatic server dicovery on lan is something a network class and ofcourse game should have.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
My Blog: http://www.freakybytes.org
that defeats the point halan. i just wanted to have a light weight network class and not such a big system. and i guess zoidcom isn't for free.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Broadcasting is the best way, and every network library should support broadcast, it's the simplest of all UDP/TCP/Multicast protocols. Multicast basically is broadcast, unless you are on a multicast aware network with multicast aware routers( otherwise switches/hubs just "broadcast" multicast to every computer on the network and it's up to the network device on the computer to know whether it's joined to a multicast group or not ).
I don't know ENET, or any of these other libraries, but if they happen to not support broadcast, I can supply you with REALLY simple code for opening a UDP Broadcast Tx socket and a UDP Broadcast Rx socket.
I don't know ENET, or any of these other libraries, but if they happen to not support broadcast, I can supply you with REALLY simple code for opening a UDP Broadcast Tx socket and a UDP Broadcast Rx socket.

oh man i don't really remember when i opend this thread.....
i tried to to what u said with the multicast but i couldn'T get it to work with enet.
so if u could lead me in the right direction i might be able to finish it off.
i tried to to what u said with the multicast but i couldn'T get it to work with enet.
so if u could lead me in the right direction i might be able to finish it off.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
IrrNet only uses Enet, doesn't it? I already stated I have no clue what the capabilities or usage of Enet is.
I have done network programming for over 6 years now, at my job, using Unicast UDP, Broadcast UDP, TCP, Multicast, MDP( Multicast Dissemination Protocol ), NORM( Nack Oriented Reliable Multicast ) and even PGM( which isn't yet implemented properly on Windows, but is the only OS which has implemented the Cisco RFC in Win XP SP2, Win Server 2003 and Vista ).
Anyways, Rx broadcast socket, is just a socket which is setup to receive broadcast data, on a specific port. Tx, is for transmit. Nowadays, with full-duplex connections to switches and routers, and even hubs pretty much standard, and with the speed of computers, you really don't need to multi-thread and have separate send and receive sockets on UDP, it's just what I'm used to.
Sudi, if you still need help, just PM me or email me.
I have done network programming for over 6 years now, at my job, using Unicast UDP, Broadcast UDP, TCP, Multicast, MDP( Multicast Dissemination Protocol ), NORM( Nack Oriented Reliable Multicast ) and even PGM( which isn't yet implemented properly on Windows, but is the only OS which has implemented the Cisco RFC in Win XP SP2, Win Server 2003 and Vista ).
Anyways, Rx broadcast socket, is just a socket which is setup to receive broadcast data, on a specific port. Tx, is for transmit. Nowadays, with full-duplex connections to switches and routers, and even hubs pretty much standard, and with the speed of computers, you really don't need to multi-thread and have separate send and receive sockets on UDP, it's just what I'm used to.
Sudi, if you still need help, just PM me or email me.
