Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

"System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. " when using Microsoft.SharePoint.Client.File.SaveBinaryDirect method.

$
0
0

Hi all,

I'm trying to use Microsoft.SharePoint.Client.File.SaveBinaryDirect to upload file to SharePoint library. I ocacionally get this "System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. " . Does anyone have clue? below are the stack trace:

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection:

An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException:An existing connection was forcibly closed by the remote host


   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)


   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)


   --- End of inner exception stack trace ---


   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)


   at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)


   at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)


   at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)


   at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)


   at System.Net.TlsStream.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)


   --- End of inner exception stack trace ---


   at System.Net.HttpWebRequest.GetResponse()


   at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()


   at Microsoft.SharePoint.Client.File.SaveBinary(ClientContext context, String serverRelativeUrl, Stream stream, String etag, Boolean overwriteIfExists, SaveBinaryCheckMode checkMode)


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>