Skip to content

System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. #93

@nj4x

Description

@nj4x

System.InvalidOperationException occured when using WampSharp (1.2.2.56-dev) as a client.

To reproduce:

a) Start crossbar using .crossbar\config.json
b) Open subscriber
c) Run publisher

After some time, System.InvalidOperationException is thrown

System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
   at System.Threading.Tasks.TaskCompletionSource`1.SetException(Exception exception)
   at WampSharp.V2.Client.WampPendingRequestBase`2.SetException(Exception exception)
   at WampSharp.V2.Core.WampRequestIdMapper`1.SetException(Exception exception)
   at WampSharp.V2.Client.WampPublisher`1.ConnectionBroken(Object sender, WampSessionCloseEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at WampSharp.V2.Client.WampSessionClient`1.OnConnectionBroken(WampSessionCloseEventArgs e)
   at WampSharp.V2.Client.WampSessionClient`1.RaiseConnectionBroken[T](IWampFormatter`1 formatter, SessionCloseType sessionCloseType, T details, String reason)
   at WampSharp.V2.Client.WampSessionClient`1.OnConnectionClosed()
   at WampSharp.V2.Client.WampClient`1.OnConnectionClosed()
   at WampSharp.V2.Client.WampChannel`1.OnConnectionClosed(Object sender, EventArgs e)
   at WampSharp.WebSocket4Net.WebSocket4NetConnection`1.RaiseConnectionClosed()
   at WampSharp.WebSocket4Net.WebSocket4NetConnection`1.WebSocketOnClosed(Object sender, EventArgs eventArgs)
   at WebSocket4Net.WebSocket.FireClosed()
   at WebSocket4Net.WebSocket.OnClosed()
   at WebSocket4Net.WebSocket.client_Closed(Object sender, EventArgs e)
   at SuperSocket.ClientEngine.ClientSession.OnClosed()
   at SuperSocket.ClientEngine.AsyncTcpSession.OnClosed()
   at SuperSocket.ClientEngine.AsyncTcpSession.Sending_Completed(Object sender, SocketAsyncEventArgs e)
   at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
   at System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(Object ignored)
   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)connection error. error: System.Net.Sockets.SocketException (0x80004005)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions