Solved

Contacting an IP behind a router MSN Messeneger style

Posted on 2004-10-06
8
172 Views
Last Modified: 2010-04-15
Hi,

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?

Cheers,
Little'un
0
Comment
Question by:littlecharva
  • 3
8 Comments
 
LVL 7

Expert Comment

by:God_Ares
ID: 12236275
That would be upnp,.. http://www.hypermoose.com/ has an opensource implementation,.. also see http://www.codeproject.com/dotnet/netconfig.asp. Hope this helps you out. (upnp nat required,.. simple (w2000??)/xp inet sharing is upnp enabled)

regards

Floris Briolas
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12236474
I encountered the same problem once.
What I did was published my internat IP as well Routes IP to the web site that stores the IP,

Then established three cases
1. If both have direct IP, the sender connects with the reciever whcih is lsitening and send the file
2. If one is behind the LAN and other is directly connected.. The connection request will made from the computer which is behind LAN to the the computer which is Directly connected.
3. Both are behind the LAN, the sender requests and the server and asks both of them to create a new connection for File transfer and then the file is transfered via Server,

I hope it helps

If you need more explaination ask me
0
 

Author Comment

by:littlecharva
ID: 12236760
God Ares: That HyperMoose thing's docs don't cover it well enough, so I can't figure out how to do it, and the other link uses the moose classes, so that's no good either.

armoghan: I could do with a little more explanation.  What do you mean by publishing your internat IP AND your Routes IP, what are the differences?

Cheers,
0
 
LVL 7

Expert Comment

by:God_Ares
ID: 12246160
littlecharva,

Sorry i can't give some code right now. But there is more expl on http://www.upnp.org/

the point is, you are making a request to the nat, to route a port. And the other side does this as well. I guess if both are behind a firewall, there is third party  needed to help out in the handsake. After that there is no need for the third party.

I'll try to write an example this weekend. This will mean i've to reconfigue my server and such,.. will you be patient?

for the meanwhile,.. i reccomend you run the tester from hypermoose. To be honast i've never played with upnp,.. but most questions i awnser i do for the first time.. :)

regards

Floris Briolas
0
 
LVL 7

Accepted Solution

by:
God_Ares earned 125 total points
ID: 12274791
Yeah well sorry,.. i need xp to get this to work,.. i've got an 2000 server,.. so it's up to you what to do,..

here some more links,.. worth reading do!

http://www.updatexp.com/upnp.html  <- general what upnp is and why it has been created.

www.upnp.org <- well a m$ site doesn't looks like it but i thing upnp has been patended by m$,.. not shure do... you ware complaining about a lack of documentation, well this site provides,..

sorry I coudn't fix you with a sample.. would have loved to give you one.

regards

Floris Briolas


more links:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/upnp/upnp/overview_of_universal_plug_and_play.asp
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Filename to be appended with DateTimeof Download 3 55
SQL Query Producing decimal places when it shouldn;t be 8 43
converto datetime always changes format 9 35
Graphics 2 27
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question