The underlying connection was closed: An unexpected error occurred on a receive

转自:

http://www.outsystems.com/forums/discussion/15641/tip-the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-rece/

Symptom

You application is making a call to another system performing an HTTP(S) request. This request can be a:

  • Web service call (SOAP or REST)
  • A request to a specific web-page
  • Sending an email
  • ...

The call is failing and an error occurs in the application. In the Error Log you see an entry similar to (below example is for a SOAP web-reference):

[1] The underlying connection was closed: An unexpected error occurred on a receive.
   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at ssCRMApp.WRefPeopleLookup.WRefPeopleLookup.SearchByName(String search)
 
[2] Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
 
[3] An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
 


Cause
Errors like these happen because the remote server (to which the call was being made) did not deliver a response to your request and cut the connection before an answer could be sent. Meaning:

  1. Your application (the caller) sent the request
  2. While the application was waiting for the response, the remote server cut the connection.


Resolution
Resolving such a problem cannot be done on the caller side (your application) - you need to work with the party that provides the service for you.

If you are the other party or want to help: common causes on the other side for these errors are:

    • The request is taking too long to run and the server "times it out". If another OutSystems Platform is on the receiving end (meaning: the web call is to an OutSystems Platform) you may want to look here.
    • The remote server is having issues. E.g. application pool recycling or crashes that interrupt logic that may be runnning.
    • A network layer is cutting the network connection half-way. You may see errors in the remote server similar to this one (e.g. "could not flush response);

转载于:https://www.cnblogs.com/iot1024/p/5013394.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值