本文介绍了套接字连接已中止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到异常



套接字连接已中止。这可能是由于

处理您的消息错误

或远程主机超出接收超时,
或底层网络资源问题。

本地套接字超时为10675199.02:48:05.4775807





我的托管设置为



((NetTcpBinding)MyBinding).Security.Mode = SecurityMode.None;

((NetTcpBinding)MyBinding).SendTimeout = TimeSpan.MaxValue;

((NetTcpBinding)MyBinding).ReceiveTimeout = TimeSpan.MaxValue;

((NetTcpBinding)MyBinding).OpenTimeout = TimeSpan.MaxValue;

((NetTcpBinding)MyBinding).CloseTimeout = TimeSpan.MaxValue;

((NetTcpBinding)MyBinding).MaxBufferSize = int.MaxValue;

((NetTcpBinding)MyBinding).MaxReceivedMessageSize = int.MaxValue;

((NetTcpBinding)MyBinding).PortSharingEnabled = true;

((NetTcpBinding)MyBinding).TransferMode = TransferMode.Buffered;

((NetTcpBinding)MyBinding).ListenBacklog = 10;

((NetTcpBinding)MyBinding)。 MaxConnections = 100;

((NetTcpBinding)MyBinding).TransactionProtocol = TransactionProtocol.OleTransactions;

i am getting Exception as

The socket connection was aborted. This could be caused by
an error processing your message
or a receive timeout being exceeded by the remote host,
or an underlying network resource issue.
Local socket timeout was 10675199.02:48:05.4775807


My Setting for hosting is

((NetTcpBinding)MyBinding).Security.Mode = SecurityMode.None;
((NetTcpBinding)MyBinding).SendTimeout = TimeSpan.MaxValue;
((NetTcpBinding)MyBinding).ReceiveTimeout = TimeSpan.MaxValue;
((NetTcpBinding)MyBinding).OpenTimeout = TimeSpan.MaxValue;
((NetTcpBinding)MyBinding).CloseTimeout = TimeSpan.MaxValue;
((NetTcpBinding)MyBinding).MaxBufferSize = int.MaxValue;
((NetTcpBinding)MyBinding).MaxReceivedMessageSize = int.MaxValue;
((NetTcpBinding)MyBinding).PortSharingEnabled = true;
((NetTcpBinding)MyBinding).TransferMode = TransferMode.Buffered;
((NetTcpBinding)MyBinding).ListenBacklog = 10;
((NetTcpBinding)MyBinding).MaxConnections = 100;
((NetTcpBinding)MyBinding).TransactionProtocol = TransactionProtocol.OleTransactions;

推荐答案


这篇关于套接字连接已中止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 03:22