views:

508

answers:

5

The current application that I'm working on is a Client - Server C# application and work very well on a network. Now I'm thinking if it can run over the internet. The question is how to do this? How can I start the Server on my computer and in what circumstances so that every Client over the internet to connect to? What software I need to do this?

Every idee/advice can be very useful.

Thanks.

+1  A: 

Use WCF.

Oded
+4  A: 

You could use WCF services for the server and let the client app connect to it using TCP or Soap or ..

Great info here p&p app architecture and here MS WCF

To let the rest of the internet connect to your server set up an Website in IIS and register a domain name pointing it to your server's IP. Also make changes to the host file to process the requests.

rdkleine
+2  A: 

As long as the network you are on allows incoming connections to your IP address, you should be fine. Though be aware that most people's home network setup involves a router sitting in front of your public IP address, and all of your computers/laptops/game consoles having only IP addresses for that network. This means that you will probably have to set up your router to forward a port or two to the computer running the server.

Joel Martinez
A: 

In this case what you're going to need to do is either:

  • purchase server space from a web hosting company (consider Windows Azure)
  • expose your computer on a static ip and have the clients connect to that.

Either way I'd suggest buying a domain and pointing it to the ip. That way if/when the location where you're hosting it changes you can submit a dns change and the domain will point to the new location.

Once you have a publicly exposed system in place set up a web service to respond to the client requests.

Casey Margell
+2  A: 

Telling him to use Soap/Tcp/Wcf is pointless. He already has it running on his local network.

You can set up your home network to allow connections from the internet. Most routers have support for Dynamic DNS services. I use one to SSH into my home machine whenever I'm away from home.

It would require setting up your router at home to forward the appropriate ports, and setting it up to work with the Dynamic DNS service, but afterwards you can access it from anywhere on the internet with the domain name you set up with the DDNS service, and everything should go off without a hitch.

Bryan Ross
It will work even if the Server is a C# Application (Windows Forms Application) ?
Emanuel
It makes no difference at all. You are simply sending the packets (which are unrelated to your programming language or development environment) along a different route through the network (whether that be your LAN or the web at large).
Rushyo