none
Restart Signalr on an OWIN self hosted server RRS feed

  • Question

  • I'm self hosting owin and using signalr in a wpf application to let a user access a real time webview. I am able to start the server and create a hub connection using this code.

    Public Sub SatartWebUi()
        _server = WebApp.Start(Of Startup)(Url)
        _hubConnection = New HubConnection(Url)
        _hubProxy = _hubConnection.CreateHubProxy("myHub")
        _hubConnection.Start().Wait()
    End Sub

    Then some time later the user can stop the server using this code which also works.

    Public Sub EndWebUi()
        _hubConnection.Stop()
        _server.Dispose()
    End Sub

    My problem is the user should be able to restart the server. When I call the function StartWebUi to try and start it again the line _hubConnection.Start().Wait() causes this error: TimeoutException: Transport timed out trying to connect

    If I comment out the _hubConnection.Start().Wait()line The server starts and normal web browsing works

    Full Error Log

    App Exception ; Exception details = The I/O operation has been aborted because of either a thread exit or an application request [   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The operation was canceled. [   at System.Threading.CancellationToken.ThrowOperationCanceledException() ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The operation was canceled. [   at System.Threading.CancellationToken.ThrowOperationCanceledException()
       at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The operation was canceled. [   at System.Threading.CancellationToken.ThrowOperationCanceledException()
       at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The I/O operation has been aborted because of either a thread exit or an application request [   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__30.MoveNext() ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The operation was canceled. [   at System.Threading.CancellationToken.ThrowOperationCanceledException()
       at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The I/O operation has been aborted because of either a thread exit or an application request [   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The operation was canceled. [   at System.Threading.CancellationToken.ThrowOperationCanceledException()
       at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext() ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An operation was attempted on a nonexistent network connection [   at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The I/O operation has been aborted because of either a thread exit or an application request [   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An operation was attempted on a nonexistent network connection [   at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The operation was canceled. [   at System.Threading.CancellationToken.ThrowOperationCanceledException()
       at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An operation was attempted on a nonexistent network connection [   at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<WriteAsyncCore>d__41.MoveNext() ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An operation was attempted on a nonexistent network connection [   at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<WriteAsyncCore>d__41.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The operation was canceled. [   at System.Threading.CancellationToken.ThrowOperationCanceledException()
       at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.AspNet.SignalR.WebSockets.WebSocketMessageReader.<ReadMessageAsync>d__3.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An operation was attempted on a nonexistent network connection [   at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<WriteAsyncCore>d__41.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<SendFrameAsync>d__48.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An internal WebSocket error occurred. Please see the innerException, if present, for more details.  [   at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted) ] : Inner Exception = The I/O operation has been aborted because of either a thread exit or an application request [   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext() ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An operation was attempted on a nonexistent network connection [   at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<WriteAsyncCore>d__41.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<SendFrameAsync>d__48.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An internal WebSocket error occurred. Please see the innerException, if present, for more details.  [   at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] : Inner Exception = The I/O operation has been aborted because of either a thread exit or an application request [   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext() ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An internal WebSocket error occurred. Please see the innerException, if present, for more details.  [   at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] : Inner Exception = The I/O operation has been aborted because of either a thread exit or an application request [   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext() ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The 'System.Net.WebSockets.ServerWebSocket' instance cannot be used for communication because it has been transitioned into the 'Aborted' state. [   at System.Net.WebSockets.WebSocketBase.ThrowIfAborted(Boolean aborted, Exception innerException) ] : Inner Exception = An internal WebSocket error occurred. Please see the innerException, if present, for more details.  [ ] : Inner Exception = An operation was attempted on a nonexistent network connection [   at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<WriteAsyncCore>d__41.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<SendFrameAsync>d__48.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<CloseOutputAsyncCore>d__51.MoveNext() ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = An internal WebSocket error occurred. Please see the innerException, if present, for more details.  [   at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.AspNet.SignalR.WebSockets.WebSocketMessageReader.<ReadMessageAsync>d__3.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] : Inner Exception = The I/O operation has been aborted because of either a thread exit or an application request [   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext() ] ; Error ; 2/12/2018 8:42:49 AM
    App Exception ; Exception details = The 'System.Net.WebSockets.ServerWebSocket' instance cannot be used for communication because it has been transitioned into the 'Aborted' state. [   at System.Net.WebSockets.WebSocketBase.ThrowIfAborted(Boolean aborted, Exception innerException)
       at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
       at System.Net.WebSockets.WebSocketBase.<CloseOutputAsyncCore>d__51.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] : Inner Exception = An internal WebSocket error occurred. Please see the innerException, if present, for more details.  [ ] : Inner Exception = An operation was attempted on a nonexistent network connection [   at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<WriteAsyncCore>d__41.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<SendFrameAsync>d__48.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<CloseOutputAsyncCore>d__51.MoveNext() ] ; Error ; 2/12/2018 8:42:49 AM
    WebUi.exe Error: 0 : Error while closing the websocket: System.Net.WebSockets.WebSocketException (0x80004005): The 'System.Net.WebSockets.ServerWebSocket' instance cannot be used for communication because it has been transitioned into the 'Aborted' state. ---> System.Net.WebSockets.WebSocketException (0x80004005): An internal WebSocket error occurred. Please see the innerException, if present, for more details.  ---> System.Net.HttpListenerException (0x80004005): An operation was attempted on a nonexistent network connection
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs)
       at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<WriteAsyncCore>d__41.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<SendFrameAsync>d__48.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Net.WebSockets.WebSocketBase.<CloseOutputAsyncCore>d__51.MoveNext()
       at System.Net.WebSockets.WebSocketBase.ThrowIfAborted(Boolean aborted, Exception innerException)
       at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
       at System.Net.WebSockets.WebSocketBase.<CloseOutputAsyncCore>d__51.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.AspNet.SignalR.WebSockets.WebSocketHandler.<>c.<<CloseAsync>b__13_0>d.MoveNext()
    App Exception ; Exception details = An asynchronous call is already in progress. It must be completed or canceled before you can call this method. [   at System.Net.ChunkParser.SetReadParameters(Byte[] userBuffer, Int32 userBufferOffset, Int32 userBufferCount) ] ; Error ; 2/12/2018 8:42:54 AM
    App Exception ; Exception details = An asynchronous call is already in progress. It must be completed or canceled before you can call this method. [   at System.Net.ChunkParser.SetReadParameters(Byte[] userBuffer, Int32 userBufferOffset, Int32 userBufferCount)
       at System.Net.ChunkParser.Read(Byte[] userBuffer, Int32 userBufferOffset, Int32 userBufferCount)
       at System.Net.ConnectStream.ReadWithoutValidation(Byte[] buffer, Int32 offset, Int32 size, Boolean abortOnError) ] ; Error ; 2/12/2018 8:42:54 AM
    App Exception ; Exception details = Cannot access a disposed object.
    Object name: 'System.Net.Sockets.NetworkStream'. [   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) ] ; Error ; 2/12/2018 8:42:54 AM
    Object name: 'System.Net.Sockets.NetworkStream'. [   at System.Net.ConnectStream.EndRead(IAsyncResult asyncResult) ] ; Error ; 2/12/2018 8:42:54 AM
    App Exception ; Exception details = Cannot access a disposed object.
    Object name: 'System.Net.Sockets.NetworkStream'. [   at System.Net.ConnectStream.EndRead(IAsyncResult asyncResult)
       at System.IO.Stream.<>c.<BeginEndReadAsync>b__43_1(Stream stream, IAsyncResult asyncResult)
       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrimPromise`1.Complete(TInstance thisRef, Func`3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ] ; Error ; 2/12/2018 8:42:54 AM
    App Exception ; Exception details = Cannot access a disposed object.
    Object name: 'System.Net.Sockets.NetworkStream'. [   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) ] ; Error ; 2/12/2018 8:42:59 AM
    App Exception ; Exception details = Cannot access a disposed object.
    App Exception ; Exception details = The request was aborted: The request was canceled. [   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) ] ; Error ; 2/12/2018 8:42:59 AM
    App Exception ; Exception details = One or more errors occurred. [   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) ] : Inner Exception = Transport timed out trying to connect [ ] ; Error ; 2/12/2018 8:42:59 AM
    Exception thrown: 'System.AggregateException' in mscorlib.dll
    App Exception ; Exception details = One or more errors occurred. [   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) ] : Inner Exception = Transport timed out trying to connect [ ] ; Error ; 2/12/2018 8:42:59 AM
    An exception of type 'System.AggregateException' occurred in mscorlib.dll but was not handled in user code
    One or more errors occurred.
    
    The program '[16776] WebUi.exe' has exited with code -1 (0xffffffff).




    Monday, February 19, 2018 9:17 PM

All replies

  • Hi cmbasse,

    Thank you for posting here.

    According to your question is more related to SignalR, you could post a new thread in ASP.NET SignalR forum for suitable support.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions. 

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 22, 2018 2:23 AM