当前位置: 代码迷 >> Web Service >> WCF服务为啥会经常崩溃呢
  详细解决方案

WCF服务为啥会经常崩溃呢

热度:337   发布时间:2016-05-02 02:47:03.0
WCF服务为什么会经常崩溃呢
我是个WCF的初学者,在服务器上架构一个WCF服务,客户端在调用WCF服务的时候如果只开一个就正常
但是如果开了9个以上就会崩溃了~必须重启WCF服务才行
哪位大大可以帮忙看下是啥为题啊~

------最佳解决方案--------------------
没几句代码注释,高手啊!!!
------其他解决方案--------------------
连接数一增加之后系统崩溃之后,如果再去连接WCF调用某个方法返回的值可能是别的方法的返回值
也就是说可能返回两列的表,也可能是三列的表~
相当吐血,感觉好像服务紊乱了~
------其他解决方案--------------------
引用:
windows 自己也有连接数限制呀。比如 XP 就是 10个。查查。


我用的Windows 2008 Server环境
您是说操作系统对最大连接数有限制,要调整服务器操作系统的连接数。。
------其他解决方案--------------------
引用:
没几句代码注释,高手啊!!!

我们部门与公司的其余部门有竞争关系,老板不让加注释~
------其他解决方案--------------------
服务端开启没有使用配置文件
开启的代码:
#region NetTcp
            ServiceHost host = null;//定义 ServiceHost
            host = new ServiceHost(typeof(Service.Archieve.ArchieveContract), new Uri("net.tcp://sc-tfsserver:8022"));//WcfDemo.Service1 为引用的dll中的服务

            NetTcpBinding netTcp = new NetTcpBinding();
            netTcp.Name = "netTcpBindingConfig";
            netTcp.CloseTimeout = new TimeSpan(0, 30, 0);
            netTcp.OpenTimeout = new TimeSpan(0, 30, 0);
            netTcp.ReceiveTimeout = new TimeSpan(0, 30, 0);
            netTcp.SendTimeout = new TimeSpan(0, 30, 0);
            netTcp.TransactionFlow = false;
            netTcp.TransferMode = TransferMode.Buffered;
            netTcp.TransactionProtocol = TransactionProtocol.OleTransactions;
            netTcp.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
            netTcp.ListenBacklog = 1000;
            netTcp.MaxBufferPoolSize = 2147483647;
            netTcp.MaxBufferSize = 2147483647;
            netTcp.MaxConnections = 1000;
            netTcp.MaxReceivedMessageSize = 2147483647;
            netTcp.PortSharingEnabled = true;
            netTcp.ReaderQuotas.MaxStringContentLength = 2147483647;
            netTcp.Security.Mode = SecurityMode.None;
            netTcp.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
  相关解决方案