title: System.Net.WebException Exception: The underlying connection was closed: An unexpected error occurred on a send. failing on social media calls
body: <p>we are using facebook graph API,Spring.Social.Twitter API for retrieving Contacts all the social media calls are failing from our web application, from all API calls we are getting a same Exception.</p>
  
  <p><strong>Twitter API GetResponse</strong></p>
  
  <pre><code>Exception Type: System.Net.WebException
  Exception: The underlying connection was closed: An unexpected error occurred on a send.
  StackTrace:    at System.Net.HttpWebRequest.GetResponse()
  
  Inner Exception ---------------------------------------------------
  Type: System.IO.IOException
  Exception: Received an unexpected EOF or 0 bytes from the transport stream.
  StackTrace:    at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
     at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
     at System.Threading.ExecutionContext.runTryCode(Object userData)
     at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
     at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
     at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
     at System.Net.ConnectStream.WriteHeaders(Boolean async)
  </code></pre>
  
  <p><strong>Facebook Graph API Call</strong></p>
  
  <p>this is the stack trace for graph API call get response </p>
  
  <pre><code>Exception Type: Facebook.WebExceptionWrapper
  Exception: The underlying connection was closed: An unexpected error occurred on a send.
  StackTrace:    at Facebook.HttpHelper.OpenRead()
     at Facebook.FacebookClient.Api(HttpMethod httpMethod, String path, Object parameters, Type resultType)
     at Facebook.FacebookClient.Get(String path, Object parameters, Type resultType)
  
  Inner Exception ---------------------------------------------------
  Type: System.IO.IOException
  Exception: Received an unexpected EOF or 0 bytes from the transport stream.
  StackTrace:    at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
     at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
     at System.Threading.ExecutionContext.runTryCode(Object userData)
     at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
     at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
     at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
     at System.Net.ConnectStream.WriteHeaders(Boolean async)
  </code></pre>
  
  <p>this is the stack trace for all the API calls.
  thanks in advance.</p>
  
  <p><strong>Note: if am Editing My Web config,Everything starts working Fine for some hours.after that same error for all the get request.</strong></p>