我有一个由 Windows 服务托管的 WCF 服务。它与网络中的零到多个客户端具有发布/订阅关系。绑定是 net.TCP。WCF 服务向客户端提供“订阅”方法,以便客户端可以注册回调处理程序。WCF 服务定期调用任何当前订阅客户端的回调处理程序中的方法。
接口定义(带缩写)如下:
[OperationContract(IsOneWay = false)]
void ReturnInitialData(
InitialData initialData,
CraneState recentState,
VerticalCraneState recentVerticalCraneState,
ThresholdState recentThresholdState,
StationaryStatusFlagsState recentStationaryStatusFlagState,
LightsState recentLights,
BarrierRiskState recentBarrierRiskState
);
当服务使用大约 42000 字节的数据调用 ReturnInitialData() 时,它可以正常工作。当服务使用大约 70000 字节的数据调用它时,它会引发以下异常:
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 '00:10:00'.
这是 netTcpBinding 配置:
General
CloseTimeout 00:00:20
HostNameComparisonMode StrongWildcard
ListenBacklog 0
MaxBufferPoolSize 524288
MaxBufferSize 2147483647
MaxConnections 0
MaxReceivedMessageSize 2147483647
OpenTimeout 00:01:00
PortSharingEnabled False
ReceiveTimeout 00:10:00
SendTimeout 00:10:00
TransactionFlow False
TransactionProtocol Ole Transactions
TransferMode Buffered
ReaderQuotas Properties
MaxArrayLength 0
MaxBytesPerRead 0
MaxDepth 0
MaxNameTableCharCount 0
MaxStringContentLength 0
ReliableSession Properties
Enabled False
InactivityTimeout 00:10:00
Ordered True
欢迎任何线索或指示。