473,769 Members | 2,240 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Searching for computers on a LAN

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

Oct 29 '08 #1
3 5027
"Brian Odsgaard" <ma**@oddball.r emove.dkwrote in news:4907b56b$0 $15899
$e*******@dtext 01.news.tele.dk :
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.
Oct 29 '08 #2
On Wed, 29 Oct 2008 19:05:02 GMT, Ian Shef <in*****@avoidi ng.spam>
wrote:
>"Brian Odsgaard" <ma**@oddball.r emove.dkwrote in news:4907b56b$0 $15899
$e*******@dtex t01.news.tele.d k:
>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
Oct 30 '08 #3
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" <in*****@avoidi ng.spamwrote in message
news:Xn******** *************** *****@138.126.2 54.210...
"Brian Odsgaard" <ma**@oddball.r emove.dkwrote in news:4907b56b$0 $15899
$e*******@dtext 01.news.tele.dk :
>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.

Nov 14 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1819
by: Denny Schierz | last post by:
hi, i have a logical error in my css file, but i don't no where. have a look: http://lippelt-back.com/fileadmin/template/css/new-body.css i comment this lines:
2
4030
by: Dannic | last post by:
Here is the application. Its a simple application really. I have a db created in Access 2000 which opens to a switchboard created by the switchboard manager. Now the problem. This only works on some computers. I installed access 2000 on two brand new, out of the box, computers and on one it gives me a run time error and the other it doesn't. Both computers are running windows XP. Though the operating system doesn't seem to be the...
10
6046
by: MHenry | last post by:
Hi, We were going merrily along for 6 years using this database to record all client checks that came into our office, including information about what the checks were for. Suddenly, network computers cannot access the database. The message is...
8
2707
by: Vanga Sasidhar | last post by:
I have four computers. One computer - Win XP Two computers - Win 98 One computer - Win ME I designed some pages in my computer having Win XP operating system. I installed dot net framework 1.1 and web matrix is used for asp .net code
4
7697
by: JB | last post by:
I am trying to get a list of all the active computers running on my domain. I'm writing some remote management style software with WMI, which works fine when i know the computer name, but i just want to be able to produce a list and work it from there. I found the following method: String path = "WinNT://MY.DOMAIN.COM"; String username = "administrator";
17
5566
by: John Salerno | last post by:
Let me see if this question even makes sense...I'm reading Core Python Programming and I jumped ahead to the more specific topics like network programming. I plan to follow along with the example in that chapter and create a socket connection between my desktop and laptop. However, these two computers are already connected on my home network (using the Windows Network Setup Wizard), so I was wondering if this will have any effect on what...
8
3845
Plater
by: Plater | last post by:
I hope I can explain this correctly. BACKGROUND: My office has a local network. We use a windows server 2003(small business server i think) computer to handle our domain. So all of our employees computers are members of the domain. We can ping them all. NSLOOKUP of the PC name works. NSLOOKUP of the ipaddress works (i had the reverse pointer records created) On the server computer, we can open up the DHCP tool and see all the computers....
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.