Click here to Skip to main content
15,881,781 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi,

I am looking to create a program (.NET) that will sit on some of out clients servers, which will be constantly connected to our server so that we can send commands to it from our side to do numerous things, such as download a file, run an application etc. What would you say is the best way to go about this? I'm thinking sockets as it will give us a lot more control. My boss has suggested web services, where the service would be sitting on our server, but I don't see how that would work as the client would be waiting to hear commands, not send them out (which is how web services work, as I see it)

Any ideas?

Thanks

Rob
Posted
Comments
Richard MacCutchan 14-Jun-13 6:09am    
Your idea sounds like a good way to go. However, there is something called "push technology", which I think use web services. Google can probably find information on it for you.

1 solution

With client to server communications there are always a number of approaches.

The best approach I've found is to use some of the more advanced binding in WCF.

When you create a WCF service in .Net you can assign multiple binding types to the server so you can expose the same service as a TCP/IP network server and web service all at the same time.

With client server communications it's always best if the client initiates the handshake as you may find it difficult to get your client to open an incoming port to allow your server to start the conversation with the client.

With some of the more advanced bindings in WCF they support something called duplexing. This means the client can establish the connection, but once established the server can push messages out the client as well as the client to the server.

Here is a CodeProject article on duplexing with WCF

WCF Service Form Hosting and Duplex Communication[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900