[C#.NET] Client -> Server communication - what protocal do I use?

Soldato
Joined
12 Jun 2005
Posts
5,361
I am working on a project where a mobile phone (Windows Mobile 6.5) communicates with a Desktop PC (Windows 7) via .NET

Basically the client (phone) sends the sever (pc) a message and the server acts on that message. What protocol would I use for this sort of situation. Remoting? TCPClients/TCP Listeners? Server is always waiting for connection from client. There is only 1 client.

...In the future, the server could be sending messages back to the client if that changes your answer.

Thanks.
 
How much data are you passing back?

I'm quite a fan of using SOAP(XML) to do stuff as it's easy to see when stuff goes wrong. It does have a pretty hefty overhead though.
 
Connection will be over WIFI (LAN).
Amount of data will be bytes I expect (say anything upto 1KB). Just out of interest, is that considered a lot of data if I need quick operations?

It's an operation controller. So data will be sent from client to server either in short bursts (every second) with the chance of long intervals between data being sent

From Server to client (if implemented and depending on how much implementation) could be every second or could be every few minutes and it could have long periods of time where no data is sent.
 
Last edited:
If I remember rightly the max payload of a single 802.11g (54g) frame is 1500bytes and a basic router can process hundreds of these a second.

What is the data being sent exactly? I'm partial to XML too but it might be completely wrong depending on the contents.
 
I want the server to have as little CPU usage as possible when no connection is active (waiting for client) if that makes a difference to your response.

After some thought, and to make it so that as little data is sent over the network as possible. It will only be (initially) two bytes that are sent from the client->server everytime there is an action.
 
You'd have to screw up royally for efficiency be a problem in this scenario. This sounds like worry around premature optimisation!
 
You'd have to screw up royally for efficiency be a problem in this scenario. This sounds like worry around premature optimisation!

Yeah I am a little aware of this when I say its only two byte being sent. But I would like it to be expandable to be able to send more information if necessary. Since I didn't know how much is "a lot" of information to send over network I didn't know how to approach it.

So should I just use a TCPClient for the Client and a TCPListener for the Server then?

Whilst the client is connected to the server I need the server to get the information as quick as possible so I take it that I should keep the connection active.
 
Last edited:
Back
Top Bottom