English 中文(简体)
How can make a C# Client - Server run over internet?
原标题:

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.

最佳回答

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.

问题回答

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.

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.

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.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签