-
Notifications
You must be signed in to change notification settings - Fork 84
Unhandeled exception #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In order to prevent this exception, please provide an OnError handler to the IObservable Subscribe extension method. |
Thanks, I missed that overload. Might me good idea to add it as an example in documentation pages. |
I had an old dll when i closed issue, with original from nuget I still get an error. Can you give mi a hint what am I missing here: reconnector.Start(); |
Don't know if it will make a difference, but you should return the Open
task from your Func.
Elad
|
Hi, but this doesn't help also. Only fix that works for me is wrapping callback call in OnConnectionError method of WampSessionClient. |
Please write full instructions to reproduce this issue and I'll try to
check it during the week.
Elad
…On 29 May 2017 2:11 pm, "seba" ***@***.***> wrote:
Hi,
Thaks for taking time to check this issue I'm having. I changed
reconnector line to
WampChannelReconnector reconnector = new WampChannelReconnector(channel,
() =>
{
return conTask();
});
but this doesn't help also. Only fix that works for me is wrapping
callback call in OnConnectionError method of WampSessionClient.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#193 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABEv9pzbApmd2NNUSf313xWDrlsMeGKbks5r-qffgaJpZM4NpB3_>
.
|
Hi, here is the project that can lead to unhandled exception. All code is in program.cs. You would also need TCPView tool free download form https://technet.microsoft.com/en-us/sysinternals/tcpview.aspx. Steps to reproduce problem:
|
You haven't added an OnError handler to the ticker subscription.
Elad
|
You are right! Thank you for your help. First time I tired your suggestion I commented out first subscription and forgot to add OnError to it. That is the reason I closed issue at first and then reopened it. One again thanks for help. |
Closing tcp connection forcibly can lead to unhandled exception. To reproduce problem connect to any server as subscriber. Then in some tool as TCPView close conection to server you subscribed to. This will throw exception like:
An unhandled exception occurred WampSharp.V2.Core.Contracts.WampConnectionBrokenException: Connection got broken. CloseType:Disconnection
at System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception)
at System.Reactive.Stubs.<>c.<.cctor>b__2_1(Exception ex)
at System.Reactive.AnonymousSafeObserver
1.OnError(Exception error) at System.Reactive.Linq.ObservableImpl.Merge
1..Iter.OnError(Exception error)at System.Reactive.Linq.ObservableImpl.SelectMany
2._.Iter.OnError(Exception error) at System.Reactive.Linq.ObservableImpl.Throw
1..Invoke()at System.Reactive.Concurrency.Scheduler.Invoke(IScheduler scheduler, Action action)
at System.Reactive.Concurrency.ImmediateScheduler.Schedule[TState](TState state, Func
3 action) at System.Reactive.Concurrency.Scheduler.Schedule(IScheduler scheduler, Action action) at System.Reactive.Linq.ObservableImpl.Throw
1._.Run()at System.Reactive.Linq.ObservableImpl.Throw
1.Run(IObserver
1 observer, IDisposable cancel, Action1 setSink) at System.Reactive.Producer
1.Run(IScheduler _, State x)at System.Reactive.Concurrency.ScheduledItem
2.InvokeCore() at System.Reactive.Concurrency.CurrentThreadScheduler.Trampoline.Run(SchedulerQueue
1 queue)at System.Reactive.Concurrency.CurrentThreadScheduler.Schedule[TState](TState state, TimeSpan dueTime, Func
3 action) at System.Reactive.Concurrency.LocalScheduler.Schedule[TState](TState state, Func
3 action)at System.Reactive.Producer
1.SubscribeRaw(IObserver
1 observer, Boolean enableSafeguard)at System.ObservableExtensions.SubscribeSafe[T](IObservable
1 source, IObserver
1 observer)at System.Reactive.Linq.ObservableImpl.SelectMany
2._.SubscribeInner(IObservable
1 inner)at System.Reactive.Linq.ObservableImpl.SelectMany
2._.OnNext(TSource value) at System.Reactive.Subjects.Subject
1.OnNext(T value)at System.Reactive.Linq.ObservableImpl.FromEventPattern.Impl
2.<>c__DisplayClass3_0.<GetHandler>b__1(Object sender, TEventArgs eventArgs) 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()at WampSharp.V2.Client.WampSessionClient
1.OnConnectionClosed() at WampSharp.V2.Client.WampChannel
1.OnConnectionClosed(Object sender, EventArgs e)at WampSharp.Core.Listener.ReviveClientConnection
1.RaiseConnectionClosed() at WampSharp.Core.Listener.ReviveClientConnection
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.SslStreamTcpSession.OnDataRead(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Security.SslStream.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.ReadHeaderCallback(AsyncProtocolRequest asyncRequest)
at System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result)
at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
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.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading.IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) stack trace at System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception)
at System.Reactive.Stubs.<>c.<.cctor>b__2_1(Exception ex)
at System.Reactive.AnonymousSafeObserver
1.OnError(Exception error) at System.Reactive.Linq.ObservableImpl.Merge
1..Iter.OnError(Exception error)at System.Reactive.Linq.ObservableImpl.SelectMany
2._.Iter.OnError(Exception error) at System.Reactive.Linq.ObservableImpl.Throw
1..Invoke()at System.Reactive.Concurrency.Scheduler.Invoke(IScheduler scheduler, Action action)
at System.Reactive.Concurrency.ImmediateScheduler.Schedule[TState](TState state, Func
3 action) at System.Reactive.Concurrency.Scheduler.Schedule(IScheduler scheduler, Action action) at System.Reactive.Linq.ObservableImpl.Throw
1..Run()at System.Reactive.Linq.ObservableImpl.Throw
1.Run(IObserver
1 observer, IDisposable cancel, Action1 setSink) at System.Reactive.Producer
1.Run(IScheduler _, State x)at System.Reactive.Concurrency.ScheduledItem
2.InvokeCore() at System.Reactive.Concurrency.CurrentThreadScheduler.Trampoline.Run(SchedulerQueue
1 queue)at System.Reactive.Concurrency.CurrentThreadScheduler.Schedule[TState](TState state, TimeSpan dueTime, Func
3 action) at System.Reactive.Concurrency.LocalScheduler.Schedule[TState](TState state, Func
3 action)at System.Reactive.Producer
1.SubscribeRaw(IObserver
1 observer, Boolean enableSafeguard)at System.ObservableExtensions.SubscribeSafe[T](IObservable
1 source, IObserver
1 observer)at System.Reactive.Linq.ObservableImpl.SelectMany
2._.SubscribeInner(IObservable
1 inner)at System.Reactive.Linq.ObservableImpl.SelectMany
2._.OnNext(TSource value) at System.Reactive.Subjects.Subject
1.OnNext(T value)at System.Reactive.Linq.ObservableImpl.FromEventPattern.Impl
2.<>c__DisplayClass3_0.<GetHandler>b__1(Object sender, TEventArgs eventArgs) 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()at WampSharp.V2.Client.WampSessionClient
1.OnConnectionClosed() at WampSharp.V2.Client.WampChannel
1.OnConnectionClosed(Object sender, EventArgs e)at WampSharp.Core.Listener.ReviveClientConnection
1.RaiseConnectionClosed() at WampSharp.Core.Listener.ReviveClientConnection
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.SslStreamTcpSession.OnDataRead(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Security._SslStream.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ReadHeaderCallback(AsyncProtocolRequest asyncRequest)
at System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result)
at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
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.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) Connection got broken. CloseType:Disconnection
The text was updated successfully, but these errors were encountered: