我在程序中使用DuplexChannelFactory<>.CreateChannel
来创建服务器和客户端之间的连接。但是,当我改变操作系统时,我的程序引发了异常。
System.ServiceModel.CommunicationObjectAbortedException:
The operation 'Ping' could not be completed because the sessionful channel timed out waiting to receive a message.
To increase the timeout, either set the receiveTimeout property on the binding in your configuration file,
or set the ReceiveTimeout property on the Binding directly.
如何在更改Windows上的时间后避免此异常?
PS。我不应该设置无限超时,因为我需要处理丢失的连接。