Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Contacting an IP behind a router MSN Messeneger style

Posted on 2004-10-06
8
175 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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 …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

789 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