PDA

Click to See Complete Forum and Search --> : Server List with Winsock


stever2003
Dec 25th, 2000, 08:08 PM
I am making chat software for my programs. I am developing them for a LAN. I'd rather not build a dedicated server, but instead make software so that there are multiple servers on a network. my plan would be for a client to find these servers on the LAN without accessing a dedicated server to retrieve the addresses. as it finds servers, the program adds them to a list. could somebody please tell me a way to do this? thanx.

- Steve

itay222
Dec 26th, 2000, 06:41 AM
ah... those chat programs when people discover the winsock...

anyhow, to your question, maybe try to "patch" your way...
use a shared text file in the network.
but i don't like it.

or, you can hard-code the list of servers in the program,
so when a client connects he tries all of them, by priority order.

anyway, i believe there's a positive answer to your questions, sorry i don't know it.

enjoy,
itay.

ccoder
Dec 27th, 2000, 03:27 PM
You may find some help at: FreeVBCode.com (http://www.freevbcode.com/). Go to the Network/Internet link.

Ceri
May 11th, 2001, 01:55 PM
On each of the server have a dedicated winsock control on them with the protocol set to UDP, set the RemotePort property to a number that you want to use and set the RemoteHost to "255.255.255.255" (all computers on network).

Once this is completed you can send you server data using the SendData method, you could send the IP address of the server followed by the name (e.g. "myserver:127.0.0.1").

To get the client computers to receive these messages you have a winsock control on the client software which also uses the UDP protocol, set the LocalPort property to that of the servers RemotePort property. Then once you have done this, everytime the server broadcasts it's information, each client that has the UDP winsock control set up, the DataArrival event will occur.

If you would like an example just ask.