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

Saturday, 2 February 2008 22:55 by RanjanBanerji

Do a search for this error and you will get plenty of hits.  What's interesting is that you will also get plenty of solutions to the problem.  Why?  Because the error can occur due to various reasons.  Well here is yet another solution because I guess there is yet another reason.

While working on a SharePoint 2007 Content Deployment we noticed that the process would fail if we had a cab file greater than about 16MB.  The failure would occur when the source machine would attempt to move the cab file (greater than 16 MB) to the destination via an HTTPWebRequest.

In the process of debugging this problem we noticed that some source machines succeeded and some failed to send the cab file.  So what was causing this problem, why was one set of machines giving us this error and another not?

After much debugging and then some help from Microsoft we tried turning off a new feature from Microsoft, i.e., The Microsoft Windows Server 2003 Scalable Networking Pack.  Amongst the features that this pack provides is the TCP Chimney Offload.

The TCP Chimney Offload will offload TCP/IP processing to your network adapter if the network adapter is capable of handling it.  Almost like handing over graphic processing to your video card and audio processing to your sound card.  MSDN documentation, however, says:

TCP Chimney offload and NetDMA will not work with the following features:

  • Windows Firewall
  • Internet Protocol security (IPsec)
  • Internet Protocol Network Address Translation (IPNAT)
  • Third-party firewalls
  • NDIS 5.1 intermediate drivers

If any one of these features is turned on, TCP Chimney offload and NetDMA will not work regardless of the registry settings. (

So just what does "TCP Chimney Offload will not work mean"?  Does it mean the offload to the network adapter will not occur or does it mean that its behavior is now undefined and that one may experience errors?  I don't know.

So on the servers where we were getting the error we set the following registry keys to 0, i.e., turning off the network pack features.

EnableTCPChimney = 0  (DWORD)
EnableRSS = 0  (DWORD)
EnableTCPA = 0  (DWORD)

The "The underlying connection was closed: An unexpected error occurred on a receive" error vanished.  So add the TCP Chimney to the list of settings you should check and change when you get this error.

Categories:   IT | SharePoint
Actions:   E-mail | Permalink | Comments (3) | Comment RSSRSS comment feed


May 23. 2008 15:30

Amir Sharif

I had the same problem. Non of the solutions worked for me. I Checked the error on server side in Global.asax. Then I realized I had to add
<httpRuntime maxRequestLength="1048576" />
to the web.config or the machine.config
Hope It works for you too

Amir Sharif

August 20. 2008 19:20




March 2. 2012 12:11


Hello Guys,

Have u found the solution for this issue?

I am also facing same issue. I have made one web service.
In my case the error is coming only in 2003 server, web service is working on Window XP machine.

I am using managed code DLL in my code.

If you find any solution please email me on

Please reply, i need help Smile



Add comment

(Will show your Gravatar icon)

  Country flag

  • Comment
  • Preview