WebSocket4Net icon indicating copy to clipboard operation
WebSocket4Net copied to clipboard

Unhandled NullReferenceException in Sending_Completed

Open pvginkel opened this issue 7 years ago • 0 comments

I got the following NullReferenceException:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at SuperSocket.ClientEngine.AsyncTcpSession.Sending_Completed(Object sender, SocketAsyncEventArgs e)
   at SuperSocket.ClientEngine.AsyncTcpSession.SendInternal(PosList`1 items)
   at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
   at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

My guess is this is actually coming from AsyncTcpSession.OnClosed() since Sending_Complete seems to do proper checking. Copying the fields in AsyncTcpSession.OnClosed() should fix this one.

  • WebSocket4Net version 0.15.2.

pvginkel avatar Dec 28 '18 13:12 pvginkel