Contacting an IP behind a router MSN Messeneger style
Posted on 2004-10-06
I'm trying to write a program that will enable me and my mates to have a shared folder on our computers that will sync with each other, so when I drop a new file in there, it notifies the other users and they automatically download the file. If there is software already available, I'm not interested, it's as much about the challenge of writing it as having the software.
I've written a basic program that does most of the work, it works like this: When the program launches, it contacts a website that stores my IP address in a database alongside my username, and sends back the last known IP addresses for the other users. The program then tries to contact each of the other users and makes a note of who is online, the other users also make a note that I'm online. Then we're up and running and the rest is easy.
This works fine when every user has a direct connection to the internet, but my machine at work goes through a router, so I don't have my own IP address. MSN Messenger seems to get around this problem, does anyone know how it does it, or how I can achieve it?