Solved

Contacting an IP behind a router MSN Messeneger style

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now