C# Network Server attached to a Router?
-
So this is probably a dumb question, but I'm new to network programming and just trying to figure out all the details... I've been messing around with settings up a Server/Client application, using the TcpClient and TcpListener objects. These are nice and easy, but how do I communicate outside of my local network? For instance, how do I start a server on a computer on my network with a router assigned address (ie. 192.168.X.XXX) and have someone else connect to it from another location? I can't just give them the 192.168.X.XXX address to type in for their TcpClient... so how do I establish a connection, or can I? Do I just need to have a server that isn't connected to the internet by a router? Basically I want to so something similar to what a game server would do... start up a game and act as the server, have people connect to it, transfer some data, then shut everything down. Is there just another way to obtain an address that will properly resolve to my server if it's on a router? Thanks in advance...
-
So this is probably a dumb question, but I'm new to network programming and just trying to figure out all the details... I've been messing around with settings up a Server/Client application, using the TcpClient and TcpListener objects. These are nice and easy, but how do I communicate outside of my local network? For instance, how do I start a server on a computer on my network with a router assigned address (ie. 192.168.X.XXX) and have someone else connect to it from another location? I can't just give them the 192.168.X.XXX address to type in for their TcpClient... so how do I establish a connection, or can I? Do I just need to have a server that isn't connected to the internet by a router? Basically I want to so something similar to what a game server would do... start up a game and act as the server, have people connect to it, transfer some data, then shut everything down. Is there just another way to obtain an address that will properly resolve to my server if it's on a router? Thanks in advance...
You must use port forwarding in the router. Just set port forwarding to IP 192.168.X.XXX and enter the port number you want (intern and extern).
-
You must use port forwarding in the router. Just set port forwarding to IP 192.168.X.XXX and enter the port number you want (intern and extern).