Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何为数百个并发连接优化/设计WCF?_C#_Wcf_Wcf Binding_Tcp Ip - Fatal编程技术网

C# 如何为数百个并发连接优化/设计WCF?

C# 如何为数百个并发连接优化/设计WCF?,c#,wcf,wcf-binding,tcp-ip,C#,Wcf,Wcf Binding,Tcp Ip,我想开发一个使用WCF的TCP服务器应用程序,它必须是高度可扩展和高性能的服务器,能够处理至少200个并发连接:通过GPRS从我的客户端获取原始数据 我的数据包括: public class RawData { public string deviceID { get; set; } public string timeStamp { get; set; } public string messageType { get; set; } public strin

我想开发一个使用WCF的TCP服务器应用程序,它必须是高度可扩展和高性能的服务器,能够处理至少200个并发连接:通过GPRS从我的客户端获取原始数据

我的数据包括:

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; }
}
我的问题是:

  • 我能用的最好的装订是什么?
    我想通过与服务器的连接回调我的客户端

  • 如何检查wcf数据包大小?
    我使用了本教程: 我的包有500长!它是以字节为单位还是以其他单位为单位

  • WCF对我们的情况足够好吗?我们使用gprs作为数据网络

  • 在这种情况下是否需要实现路由服务

  • 对于这个问题,最好的编码是什么?最佳压缩*速度


  • 回答你的问题:

  • -它是性能最好的绑定,因为它基本上是原始套接字。它还支持

  • 如果需要一次性使用,而不是用于生产监控,请尝试配置。这可以绝对记录使用通道的每条消息

  • 有点。200个并发传入连接(如果您的服务是)是(虽然可能需要一个小的连接),但是双工wcf充其量是复杂的,而且重要的是-您需要为所有客户端提供一个单一的服务实例,或者需要一些持久的备份存储来同步客户端回调委托(尽管这可以通过以下方式有效实现)

  • 除非您需要根据消息内容动态更改端点、在网络协议之间进行转换等,否则在这种情况下,除了作为一种负载平衡器之外,我看不出有任何需要使用用户。如果您确实需要扩展,您可能最好使用实际的网络负载平衡器

  • netTcpBinding默认使用二进制编码,只要通道的两端都是WCF。这是WCF中最多的绑定


  • 你们都在同一个网络上吗?是的,所有客户端都在同一个网络上,gprs APN