Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 C#3.0 C# C#4.0
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?
 
Give me example or Tutorials ...
 
Thanks.
Posted 4-Dec-12 9:55am
Comments
digimanus at 4-Dec-12 15:27pm
   
as long as the client knows where the server can be found...
TRK3 at 4-Dec-12 15:43pm
   
And there are no firewall / router restrictions...
 
If the transport mechanism is http and the server has a fixed IP address that is known or discoverable (via DNS or...) then it should just work.
 
If the transport mechanism isn't http, then the odds are that you'll have to configure firewalls and gateways so that the communication can get through -- typically gateways are configured to allow http traffic on the default http port, but most other ports and protocols are blocked by default.
 
Other than that, the only other thing you need to worry about is increased latency and reduced bandwidth (if those are factors).
digimanus at 5-Dec-12 3:56am
   
that is why I used the words CAN BE!
pablo ramos1 at 7-Dec-12 5:33am
   
Thank you digimanus & TRK3 for your responses, can you give me an illustration to understand well the problem, i don't have a fixed ip, my ip is dunamic change whenever i turn on my box(modem),the mechanism is not HTTP so how can i configure the firewall and the gatways ??!
pablo from italy
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use WCF webservices !
Build a web project using wcf!
To test it on local, host it in IIS
 
when it is done, go in your client side, add serviceReferences, enter the url of the service (it should looks like http://localhost/..../myservice.svc) and it will build the proxy class.
In your code, use it like this
using(MyServiceClient service = new MyServiceClient() )
{
     //service.mymethod();
}
 
And when your server is deployed on internet, use the same pattern with the new url!
In your web.config, change to this
<servicedebug includeexceptiondetailinfaults="false" />
<directorybrowse enabled="false" />
so your work won't be use by someone else !
 
Client side:
 
#if DEBUG
using(MyDebugServiceClient service = new MyDebugServiceClient () )
#else
using(MyProdServiceClient service = new MyProdServiceClient () )
#endif
{
     //service.mymethod();
}
 
if your server has an entity model, don't use wcf sevices, but use wcf dataservices.
Enjoy !
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Thank you digimanus & TRK3 for your responses, can you give me an illustration to understand well the problem, i don't have a fixed ip, my ip is dunamic change whenever i turn on my box(modem),the mechanism is not HTTP so how can i configure the firewall and the gatways ??! pablo from italy
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Mathew Soji 334
1 Maciej Los 295
2 BillWoodruff 290
3 Afzaal Ahmad Zeeshan 257
4 DamithSL 225
0 OriginalGriff 6,369
1 Sergey Alexandrovich Kryukov 5,973
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 4,045


Advertise | Privacy | Mobile
Web03 | 2.8.1411019.1 | Last Updated 7 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100