?
Solved

Contacting an IP behind a router MSN Messeneger style

Posted on 2004-10-06
8
Medium Priority
?
182 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
5 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 500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

616 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