-
Jul 18th, 2010, 02:40 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] TCPConnection through router
Hola all from a new member
I have written a server/client application using TCP connections. On a LAN it works just fine, since I can supply an IP-address and a port to get from client to server. The problem is that the server program is supposed to be running on a remote machine behind a router, and I can't seem to establish a connection no matter what or how I try.
In short: Computer running server application has IP A and hides behind a router with IP B. I'm using port P. Establishing a TCP connection to A:P isn't possible, due to it being a general IP supplied by the router, and using B:P will not allow me to reach the designated computer. What do I do?
Hopefully this forum can help. Thank you in advance.
Thomas
#EDIT: Forgot to write that I primarily use VB.Net, but any code solving the problem using TCP would help immensely. Converting it will be little effort compared to the hours I've spent on this.
Last edited by ThomasJohnsen; Jul 18th, 2010 at 04:55 PM.
-
Jul 18th, 2010, 07:14 PM
#2
Re: TCPConnection through router
Welcome to VBF
What you are looking for is Network Address Translation (aka NAT).
It allows you to communicate with the router and set up a forward.
I found an article for implementation in c#
http://pietschsoft.com/post/2009/02/...-via-UPnP.aspx
And a .NET library
http://code.google.com/p/dotnetportmapper/
Reading your using VB.NET I think the latter might be what you are looking for.
Delete it. They just clutter threads anyway.
-
Jul 19th, 2010, 03:32 AM
#3
Thread Starter
Fanatic Member
-
Jul 27th, 2010, 06:24 PM
#4
Member
Re: [RESOLVED] TCPConnection through router
Have you checked out port forwarding?
Like in my case I have a public ip address 11.22.33.44. Port 80 is forwarded to 10.10.10.3.
-
Jul 27th, 2010, 06:27 PM
#5
Member
Re: [RESOLVED] TCPConnection through router
Oh, I also forgot to mention in my case I hard coded my ip address into my server.
-
Jul 28th, 2010, 06:10 AM
#6
Thread Starter
Fanatic Member
Re: [RESOLVED] TCPConnection through router
Originally Posted by rudyking
Have you checked out port forwarding?
Like in my case I have a public ip address 11.22.33.44. Port 80 is forwarded to 10.10.10.3.
That is exactly what I did.
It wasn't neccessary to hard-code the IP though, since the internet provider maintains a DNS address for the router, which allows for a more flexible solution.
In truth, a mature man who uses hair-oil, unless medicinally , that man has probably got a quoggy spot in him somewhere. As a general rule, he can't amount to much in his totality. (Melville: Moby Dick)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|