Closed manveldavid closed 10 months ago
Will replacing the void
with a Task
suffice? No one is awaiting this Task
.
Ok, but this is important for throwing and catching exceptions.
I clone your library, changed void to task and exceptions started working correctly, they can now be caught and handled
Okay, I will fix this.
Thank You so much!
What's the time frame to expect a fix?
WampSharp.WebSocket.WebSocketWrapperConnection<TMessage, TRaw>.InnerConnection() is async void:
This error causes the conclusion to be unable to be caught and to break the execution of the program. Replace an async void to async Task.
Unhandled Exception: System.Net.WebSockets.WebSocketException: 'The remote party closed the WebSocket connection without completing the close handshake.' This exception is terminated and it permanent broke runtime.
StackTrace: System.Net.WebSockets.WebSocketException HResult=0x80004005 Message=The remote party closed the WebSocket connection without completing the close handshake. Source=System.Net.WebSockets StackTrace: at System.Net.WebSockets.ManagedWebSocket.d63d16.MoveNext() in C:\workspace\WampSharp\src\netstandard\Extensions\WampSharp.WebSockets\WebSockets\WebSocketWrapperConnection.cs:line 147
at System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\ExceptionServicesImpl.cs:line 16
at System.Reactive.ExceptionHelpers.Throw(Exception exception) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\ExceptionServices.cs:line 14
at System.Reactive.Stubs.<>c.<.cctor>b21(Exception ex) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\Stubs.cs:line 16
at System.Reactive.AnonymousSafeObserverb 760(IScheduler , ValueTupled12.MoveNext() in C:\workspace\WampSharp\src\netstandard\Extensions\WampSharp.WebSockets\WebSockets\WebSocketWrapperConnection.cs:line 101
at System.Threading.Tasks.Task.<>c.b 1281(Object state) in //src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 1929
at System.Threading.ThreadPoolWorkQueue.Dispatch() in //src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs:line 867
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in //src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.cs:line 77
1.MoveNext() in /_/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/ManagedWebSocket.cs:line 872 at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder
1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/PoolingAsyncValueTaskMethodBuilderT.cs:line 428 at System.Threading.Tasks.ValueTask
1.ValueTaskSourceAsTask.<>c.<.cctor>b40(Object state) in //src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ValueTask.cs:line 669 --- End of stack trace from previous location --- at WampSharp.WebSockets.WebSocketWrapperConnection2.<ReadMessage>d__18.MoveNext() in C:\workspace\WampSharp\src\netstandard\Extensions\WampSharp.WebSockets\WebSockets\WebSocketWrapperConnection.cs:line 207 at WampSharp.WebSockets.WebSocketWrapperConnection
2.1.OnError(Exception error) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\AnonymousSafeObserver.cs:line 62 at System.Reactive.Sink
1.ForwardOnError(Exception error) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\Sink.cs:line 61 at System.Reactive.Linq.ObservableImpl.Merge`1.Observables..InnerObserver.OnError(Exception error) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\Merge.cs:line 244 at System.Reactive.Sink1.ForwardOnError(Exception error) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\Sink.cs:line 61 at System.Reactive.Linq.ObservableImpl.SelectMany
2.ObservableSelector._.InnerObserver.OnError(Exception error) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\SelectMany.cs:line 954 at System.Reactive.Linq.ObservableImpl.ThrowImmediate1.Run(IObserver
1 observer) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\Throw.cs:line 57 at System.Reactive.BasicProducer1.<>c.<SubscribeRaw>b__1_0(ValueTuple
3 tuple) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\Producer.cs:line 60 at System.Reactive.Concurrency.Scheduler.<>c76`1.2 tuple) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Concurrency\Scheduler.Simple.cs:line 88 at System.Reactive.Concurrency.CurrentThreadScheduler.Schedule[TState](TState state, TimeSpan dueTime, Func
3 action) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Concurrency\CurrentThreadScheduler.cs:line 101 at System.Reactive.Concurrency.LocalScheduler.Schedule[TState](TState state, Func3 action) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Concurrency\LocalScheduler.cs:line 32 at System.Reactive.Concurrency.Scheduler.ScheduleAction[TState](IScheduler scheduler, TState state, Func
2 action) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Concurrency\Scheduler.Simple.cs:line 86 at System.Reactive.BasicProducer1.SubscribeRaw(IObserver
1 observer, Boolean enableSafeguard) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\Producer.cs:line 62 at System.Reactive.Linq.ObservableImpl.SelectMany2.ObservableSelector._.SubscribeInner(IObservable
1 inner) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\SelectMany.cs:line 930 at System.Reactive.Linq.ObservableImpl.SelectMany2.ObservableSelector._.OnNext(TSource value) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\SelectMany.cs:line 877 at System.Reactive.Subjects.Subject
1.OnNext(T value) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Subjects\Subject.cs:line 148 at System.Reactive.Linq.ObservableImpl.FromEventPattern.Impl2.<>c__DisplayClass3_0.<GetHandler>b__0(Object sender, TEventArgs eventArgs) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\FromEventPattern.cs:line 44 at WampSharp.V2.Client.WampSessionClient
1.OnConnectionError(WampConnectionErrorEventArgs e) in C:\workspace\WampSharp\src\netstandard\WampSharp\WAMP2\V2\Client\Session\WampSessionClient.cs:line 248 at WampSharp.V2.Client.WampSessionClient1.OnConnectionError(Exception exception) in C:\workspace\WampSharp\src\netstandard\WampSharp\WAMP2\V2\Client\Session\WampSessionClient.cs:line 219 at WampSharp.V2.Client.WampClient
1.OnConnectionError(Exception exception) in C:\workspace\WampSharp\src\netstandard\WampSharp\WAMP2\V2\Client\WampClient.cs:line 99 at WampSharp.V2.Client.WampChannel1.OnConnectionError(Object sender, WampConnectionErrorEventArgs e) in C:\workspace\WampSharp\src\netstandard\WampSharp\WAMP2\V2\Client\WampChannel.cs:line 40 at WampSharp.Core.Listener.ReviveClientConnection
1.RaiseConnectionError(WampConnectionErrorEventArgs e) in C:\workspace\WampSharp\src\netstandard\WampSharp\Core\Listener\Connections\ReviveClientConnection.cs:line 116 at WampSharp.Core.Listener.ReviveClientConnection1.OnConnectionError(Object sender, WampConnectionErrorEventArgs e) in C:\workspace\WampSharp\src\netstandard\WampSharp\Core\Listener\Connections\ReviveClientConnection.cs:line 45 at WampSharp.Core.Listener.AsyncWampConnection
1.RaiseConnectionError(Exception ex) in C:\workspace\WampSharp\src\netstandard\WampSharp\Core\Listener\Connections\AsyncConnection\AsyncWampConnection.cs:line 82 at WampSharp.WebSockets.WebSocketWrapperConnection2.<RunAsync>d__16.MoveNext() in C:\workspace\WampSharp\src\netstandard\Extensions\WampSharp.WebSockets\WebSockets\WebSocketWrapperConnection.cs:line 167 at WampSharp.WebSockets.WebSocketWrapperConnection
2.Inner Exception 1: IOException: Unable to read data from the transport connection: The remote host forcibly closed the existing connection.
Inner Exception 2: SocketException: The remote host forcibly closed the existing connection.