OpenAPI.Net icon indicating copy to clipboard operation
OpenAPI.Net copied to clipboard

Stream get canceled

Open Trades-King opened this issue 3 years ago • 3 comments

Hi,

i have the latest npm package and get issue sometimes in Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65

How fix it?

Exception: OpenAPI.Net.Exceptions.ReceiveException: An exception occurred while reading from stream ---> System.OperationCanceledException: The operation was canceled. at System.Threading.CancellationToken.ThrowOperationCanceledException() at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token) at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory1 buffer) at OpenAPI.Net.OpenClient.ReadTcp(CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) in //Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65 at System.Reactive.Sink1.ForwardOnError(Exception error) in //Rx.NET/Source/src/System.Reactive/Internal/Sink.cs:line 61 at OpenAPI.Net.OpenClient.OnError(Exception exception) --- End of stack trace from previous location --- at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) in //Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65 at System.Reactive.Sink1.ForwardOnError(Exception error) in //Rx.NET/Source/src/System.Reactive/Internal/Sink.cs:line 61 at OpenAPI.Net.OpenClient.OnError(Exception exception) --- End of stack trace from previous location --- at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) in //Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65 at System.Reactive.Sink1.ForwardOnError(Exception error) in //Rx.NET/Source/src/System.Reactive/Internal/Sink.cs:line 61 at OpenAPI.Net.OpenClient.OnError(Exception exception) --- End of stack trace from previous location --- at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) in //Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65 at System.Reactive.Sink`1.ForwardOnError(Exception error) in //Rx.NET/Source/src/System.Reactive/Internal/Sink.cs:line 61 at OpenAPI.Net.OpenClient.OnError(Exception exception)

Despite our best efforts, bugs can slip into releases or corner cases forgotten about. We will try our best to remedy the situation and/or provide workarounds. Note that certain (odd) behaviors are by design and as such are not considered bugs.

Which library version? last release

What are the platform(s), environment(s) and related component version(s)? dotnet

What is the use case or problem? Stream get sometimes canced

What is the expected outcome? transfer data as complete

What is the actual outcome? Stream will be closed

What is the stacktrace of the exception(s) if any?

How can i fix it?

Trades-King avatar Oct 11 '22 13:10 Trades-King

Hi,

It can happen sometimes if the server goes down temporarily or your internet, when it happens try to reconnect, or better add reconnect / retry policy by using something like Polly.

amusleh-spotware-com avatar Oct 11 '22 13:10 amusleh-spotware-com

hi, my connection cant be. I ping scorce. I must be a code issue.

BR

Daniel

Trades-King avatar Oct 11 '22 13:10 Trades-King

how use polly here? i use original client code.

Trades-King avatar Oct 11 '22 13:10 Trades-King