Connecting Tech Pros Worldwide Help | Site Map

Searching for computers on a LAN

  #1  
Old October 29th, 2008, 02:05 AM
Brian Odsgaard
Guest
 
Posts: n/a
Hi all

I'm going to build a simple multiplayer game.

The task is to create a game that runs on multiple computers on a LAN.

I want to create a solution that don't need a server running on a specific
computer with a specific IP - all computers should be able to initiate a
game and act as server.

How can I make an application search the LAN to find if any connected
computers is running as server - without knowing the IP on the other
computers?

- Brian

  #2  
Old October 29th, 2008, 08:15 PM
Ian Shef
Guest
 
Posts: n/a

re: Searching for computers on a LAN


"Brian Odsgaard" <mail@oddball.remove.dkwrote in news:4907b56b$0$15899
$edfadb0f@dtext01.news.tele.dk:
Quote:
Hi all
>
I'm going to build a simple multiplayer game.
>
The task is to create a game that runs on multiple computers on a LAN.
>
I want to create a solution that don't need a server running on a specific
computer with a specific IP - all computers should be able to initiate a
game and act as server.
>
How can I make an application search the LAN to find if any connected
computers is running as server - without knowing the IP on the other
computers?
>
- Brian
>
>
My guess is that you would perform a broadcast to all addresses on the LAN,
with a destination of a specific port # and with a specific known message
content.

Eligible servers would respond with some other known message.

You may get many responses, a single response, or no responses. You will
have to set a time limit on when the response can occur.

You may want to perform some additional negotation with or authentication of
the responding computers.

I haven't actually tried this, and I am interested in what others suggest or
have done.


  #3  
Old October 30th, 2008, 07:15 AM
Foxfire
Guest
 
Posts: n/a

re: Searching for computers on a LAN


On Wed, 29 Oct 2008 19:05:02 GMT, Ian Shef <invalid@avoiding.spam>
wrote:
Quote:
>"Brian Odsgaard" <mail@oddball.remove.dkwrote in news:4907b56b$0$15899
>$edfadb0f@dtext01.news.tele.dk:
>
Quote:
>Hi all
>>
>I'm going to build a simple multiplayer game.
>>
>The task is to create a game that runs on multiple computers on a LAN.
>>
>I want to create a solution that don't need a server running on a specific
>computer with a specific IP - all computers should be able to initiate a
>game and act as server.
>>
>How can I make an application search the LAN to find if any connected
>computers is running as server - without knowing the IP on the other
>computers?
>>
>- Brian
>>
>>
>
>My guess is that you would perform a broadcast to all addresses on the LAN,
>with a destination of a specific port # and with a specific known message
>content.
>
>Eligible servers would respond with some other known message.
>
>You may get many responses, a single response, or no responses. You will
>have to set a time limit on when the response can occur.
>
>You may want to perform some additional negotation with or authentication of
>the responding computers.
>
>I haven't actually tried this, and I am interested in what others suggest or
>have done.
For auto-discovery on a LAN -- using Java -- I think you will want
multicast sockets.

http://www.oser.org/~hp/ds/node27.html
  #4  
Old November 14th, 2008, 10:15 AM
Solang
Guest
 
Posts: n/a

re: Searching for computers on a LAN


I am still learning Java, but I had done it in C using socket. For Lan game,
I assume
that the program has both server and client. I am using multicast socket for
advertizing
the server on the Lan with a specific message(IP address and port for
Unicast); Before
starting the Multicast, the server has already started using Unicast socket.
The broadcast
message is sent every second or so. Once the client receives the broadcast
message,
it can use the IP and port to connect to the server. However, I had not
tried Multicast
only for actyual playing the game since every single message sent to
Multicast socket
will be recieved by other computer without loosing a bit. Since there is a
limited number of sockets
is allowed, using Multicast socket will allow more participants for the
game. The drawback
for this Multicast socket is that the computers outside the Lan can not
play.



"Ian Shef" <invalid@avoiding.spamwrote in message
news:Xns9B467AECA2E34vaj4088ianshef@138.126.254.21 0...
Quote:
"Brian Odsgaard" <mail@oddball.remove.dkwrote in news:4907b56b$0$15899
$edfadb0f@dtext01.news.tele.dk:
>
Quote:
>Hi all
>>
>I'm going to build a simple multiplayer game.
>>
>The task is to create a game that runs on multiple computers on a LAN.
>>
>I want to create a solution that don't need a server running on a
>specific
>computer with a specific IP - all computers should be able to initiate a
>game and act as server.
>>
>How can I make an application search the LAN to find if any connected
>computers is running as server - without knowing the IP on the other
>computers?
>>
>- Brian
>>
>>
>
My guess is that you would perform a broadcast to all addresses on the
LAN,
with a destination of a specific port # and with a specific known message
content.
>
Eligible servers would respond with some other known message.
>
You may get many responses, a single response, or no responses. You will
have to set a time limit on when the response can occur.
>
You may want to perform some additional negotation with or authentication
of
the responding computers.
>
I haven't actually tried this, and I am interested in what others suggest
or
have done.
>
>
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need info, books, articles,code, etc: Access VBA to XML to/from MySQL via HTTP Cheryl Langdon answers 15 April 25th, 2006 12:05 AM
Secure Database Systems Sarah Tanembaum answers 4 November 13th, 2005 01:53 AM
at wit's end about corrupted records in Access 2k table! Lee Rouse answers 28 November 12th, 2005 08:33 PM
Secure Database Systems Sarah Tanembaum answers 6 July 17th, 2005 08:05 AM