I want to develop a TCP server application using WCF which must be highly scalable and high performance server that can handle at least 200 concurrent connections: getting raw data via GPRS from my clients.
My data includes:
public class RawData
{
public string deviceID { get; set; }
public string timeStamp { get; set; }
public string messageType { get; set; }
public string driverId { get; set; }
public string senosrs { get; set; }
public string startStatus { get; set; }
public string x { get; set; }
public string y { get; set; }
public string course { get; set; }
public string speed { get; set; }
public string satCount { get; set; }
public string signal { get; set; }
public string message { get; set; }
}
And my questions are:
What is the best binding I can use?
I want to callback my client through connections made to our server.
How can I inspect wcf packet size?
I have used this tutorial:
http://zamd.net/2008/08/15/calculating-wcf-message-size/
my packet was 500 long! Is it in bytes or some other units?
Is WCF good enough for our situation? We use gprs as DataNetwork.
Is there a need to implement routing service in this situation?
What is best encoding for this problem? Best compression*speed.
In answer to your questions:
netTcpBinding - it is the most performant binding because it's basically raw sockets. It also supports duplex.
If you need it as a one off and not for production monitoring, try configuring wcf tracing. This can log absolutely every message using the channel.
Kinda. 200 concurrent incoming connections (if your service is stateless) is fairly easy (though probably requiring a small scale out), but duplex wcf is complex at best, and importantly does not scale well - you either need a single service instance for all clients, or you need some persistent backing store to synchronize the client callback delegates (though this could be achieved efficiently with caching).
Unless you need to dynamically change the endpoint based on message content, translate between network protocols, etc, then no I can't see any need to user wcf-routing in this scenario, other than as a kind of load balancer. And if you do need to scale out, you would probably be better off using an actual network load balancer.
netTcpBinding uses binary encoding by default as long as both ends of the channel are WCF. This is the most optimized binding in WCF.