Click to See Complete Forum and Search --> : search lan for tcp server


venAdder
November 20th, 2005, 07:06 PM
hi,

I am writing a game in managed c++. The game consists of two players. One player has a server runing on his machinewhich will wait for connection from other player. The other player is supposed to search for the server on the LAN. I have no idea how can i accomplish other player searchign lan for this server. Can comeone please point me in direction how can i accomplish this, perhaps an article i can read which will point me in right direction?

Will greatly appreciate any help!
Thank You

ahoodin
November 21st, 2005, 07:40 AM
You can broadcast with UDP or multicast with TCP.
http://tangentsoft.net/wskfaq/intermediate.html#broadcast
http://www.tldp.org/HOWTO/Multicast-HOWTO.html
This would allow for a packet to be broadcast or multicast out on the network and the server could answer with some sort of a "<ACK>Here I am!<FFT><FFT>"

HTH,

ahoodin

PS...and if it did help, don't forget to rate!