2012-11-26 2 views
2

내가 트위터와 다음에 대한 twitterizer을 사용하여 폐쇄하지만, 파일 TwitterCommand.cs에서, 라인Twitterizer 기본 연결이

responseData = ConversionUtility.ReadStream(exceptionResponse.GetResponseStream()); 

에 나는 예외가되었다 : 기본 연결이 닫혔습니다 : 예상 된 연결을 서버에 의해 닫혔습니다.

exceptionResponse가 null의 경우, 이렇게 던져 예외 같은 코드 상단 외모 : http://api.twitter.com/1/statuses/update.json, 그래서이 :

// The exception response should always be an HttpWebResponse, but we check for good measure. 
HttpWebResponse exceptionResponse = wex.Response as HttpWebResponse; 

if (exceptionResponse == null) 
{ 
    throw; 
} 

왜 그렇게 = \

코드에

열린 우리당, 이해 할 수 없습니다 상태 (tweeting)를 갱신 할 때의 예외.

TwitterStatusAsync.Update(token, tweet, null, TimeSpan.FromSeconds(0), (resp) => 
     { 
      TwitterAsyncResponse<TwitterStatus> response = resp; 
      if (response.Result != RequestResult.Success) 
      { 
       this._twtLogger.addLine(String.Format("{0}: error when get response from server", account.title)); 
       this._twtLogger.addLine(String.Format("{0}: {1}", account.title, response.ErrorMessage)); 
       return; 
      } 

      this._twtLogger.addLine(String.Format("{0}> {1}: Tweeted ok!", response.ResponseObject.CreatedDate, account.title)); 
     }); 

추가 :

System.Net.WebException was unhandled by user code 
    Message=The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. 
    Source=System 
    StackTrace: 
     at System.Net.HttpWebRequest.GetResponse() 
     at Twitterizer.WebRequestBuilder.ExecuteRequest() 
     at Twitterizer.Core.TwitterCommand`1.ExecuteCommand() 
     at Twitterizer.Core.CommandPerformer.PerformAction[T](ICommand`1 command) 
     at Twitterizer.TwitterFriendship.Create(OAuthTokens tokens, Decimal userId, CreateFriendshipOptions options) 
     at Twitterizer.TwitterFriendship.Create(OAuthTokens tokens, Decimal userId) 
     at Twtt2.Core.TwitterActions.twtActions.Follow(twtTwitterAccount account, QueueElement QueElement, OAuthTokens token) in C:\Users\fs\Documents\Visual Studio 2010\Projects\Twtt2\Twtt2\Core\TwitterActions\twtActions.cs:line 148 
     at Twtt2.Core.TwitterActions.twtActions.Process(EQueue eq) in C:\Users\fs\Documents\Visual Studio 2010\Projects\Twtt2\Twtt2\Core\TwitterActions\twtActions.cs:line 40 
     at Twtt2.Core.AppQueueProcessor.<QueueProc>b__7(EQueue eq) in C:\Users\fs\Documents\Visual Studio 2010\Projects\Twtt2\Twtt2\Core\AppQueueProcessor.cs:line 90 
     at System.Threading.Tasks.Parallel.<>c__DisplayClass2d`2.<ForEachWorker>b__23(Int32 i) 
     at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.<ForWorker>b__c() 
    InnerException: System.IO.IOException 
     Message=Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. 
     Source=System 
     StackTrace: 
      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) 
     InnerException: System.Net.Sockets.SocketException 
      Message=An existing connection was forcibly closed by the remote host 
      Source=System 
      ErrorCode=10054 
      NativeErrorCode=10054 
      StackTrace: 
       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) 
      InnerException: 
+0

예외의 스택 추적을 게시 할 수 있습니까? –

+0

어떻게 할 수 있습니까? – user1612334

+0

가 추가 되었습니까? – user1612334

답변

0

연결 문제 것으로 보인다 업데이트

은이 코드를 사용합니다. 프록시/방화벽 설정을 확인하십시오. 또한 동기 호출을 시도하고 작동하는지 확인하십시오. (의심 스럽지만 문제를 디버깅하는 데 도움이 될 것입니다.)

+0

이것은 30 분 또는 1 시간 동안 멋진 tweeting 후 발생합니다. = \ – user1612334

+0

캔트가이 문제를 해결하는 방법을 이해합니다. (싱크도 예외와 충돌합니다. – user1612334