“约30秒后,”现有连接被远程主机强行关闭“

时间:2017-01-24 12:49:17

标签: c# wcf

我在IIS7上托管了WCF服务,它已经开始“强行关闭连接”。

EG。当发送请求时,应用程序开始处理它,并且平均时间连接被关闭以及以下异常

An error occurred while receiving the HTTP response to https://############/#########.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

An existing connection was forcibly closed by the remote host

端点使用SSL(TLS1.0)。

如果请求持续时间少于30秒,则会正确检索响应,但如果请求持续时间超过30秒,则会强制关闭连接(请求在端点上继续执行并完成,但从不检索响应)

1 个答案:

答案 0 :(得分:0)

您需要配置maxReceivedMessageSize并将其设置为您要支持的最大字节数。并根据您的要求提供receiveTimeout。 示例:

         <binding name="Your Binding Name" receiveTimeout="00:01:00" maxReceivedMessageSize="" />