Sign in to follow this  
TheBluMage

Two Dynamic IPs finding each other

Recommended Posts

TheBluMage    372
Okay, I'm pretty sure this isn't possible, but I wanted to check and see if there's some mystery protocol or something that I've missed in my research that could accomplish this. Is there any way for two computers with dynamic IP addresses on the internet to communicate without third-party help?

Share this post


Link to post
Share on other sites
fastlane69    248
Absolutely. Dynamic IPs are the same as Normal IPs...they will just get reset after a while.

Thus as long as you aren't reset, two dynamic IPs will have no problem finding each other. ONce they reset, you'll need to reconnect though.

Share this post


Link to post
Share on other sites
Michalson    1657
I'm guessing that you mean two parties that *don't* know each others IP, for example two players who want to play with someone online, but without a central match making server. The answer would be no.

If you want you can create a matchmaking server on a free PHP/MySQL server:

register.php - stores the IP and time register was requested in a MySQL database. If the IP is already in the database, the time is simply updated.

unregister.php - removes the IP from the database

list.php - lists all IPs that have been reported active in the last X minutes (by register.asp)


This provides you with a method of getting the IP of various servers. You can store more information, such as allowing it to store the type of game and when periodically updated, stats like the number of players. Or you could use the IPs as a springboard to a P2P style system (where you create nodes that store the information from many servers, so that you don't have to individually contact all players in the list to find out server information).

Share this post


Link to post
Share on other sites
TheBluMage    372
Yeah, you're right, Michalson. (Sorry about the vagueness in my original post.) I do want them to be able to communicate without knowing each other's IP addresses - at least enough that one could learn the other's IP address and communicate with it using conventional methods (TCP, UDP). There's no way to do this without a server or static IP to tell one computer about the other's IP address is there?

Share this post


Link to post
Share on other sites
Michalson    1657
On a local area network, maybe (broadcasting), but you can't broadcast on the Internet. You're asking for a way to poll 4 billion possible computers, it can't be done and shouldn't be done.

Share this post


Link to post
Share on other sites
Not unless the 2 pcs are connected via a network that supports broadcasting. If so, you could broadcast "hey look at me! im running this game and my ip/port details are.." and all the nodes on the network would receive that message, those who are listening (ie looking for a game to play in) would pay attention, the others would just ignore it. Theres no guarentee that two nodes on the internet would have such a broadcast option available and would be very resource consuming (and subject to abuse)

Otherwise as michalson said, you need a master server thats has a static location which would report everyone running a game.

[added:] ah, michalson got in there before me

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this