Skip to content
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

PancakeSwap Websocket Connection does not stay alive; closes after some time #1

Open
sadhippo opened this issue May 4, 2023 · 1 comment

Comments

@sadhippo
Copy link

sadhippo commented May 4, 2023

Using this example for PancakeSwap: https://github.com/Nethereum/Nethereum.Templates.WebSocketStreaming/blob/master/ExampleLogsUniswapSyncSubscription.cs#L70

After 5-10 minutes, the connection closes and cannot be reconnected to.

Error message:
Nethereum.JsonRpc.Client.RpcClientUnknownException: Error occurred trying to send web socket requests(s)
---> System.Net.WebSockets.WebSocketException (0x80004005): The WebSocket is in an invalid state ('Aborted') for this operation. Valid states are: 'Open, CloseReceived'
at System.Net.WebSockets.WebSocketValidate.ThrowIfInvalidState(WebSocketState currentState, Boolean isDisposed, WebSocketState[] validStates)
at System.Net.WebSockets.ManagedWebSocket.SendPrivateAsync(ReadOnlyMemory`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken)
--- End of stack trace from previous location ---
at Nethereum.JsonRpc.WebSocketStreamingClient.StreamingWebSocketClient.SendRequestAsync(RpcRequestMessage request, IRpcStreamingResponseHandler requestResponseHandler, String route)
--- End of inner exception stack trace ---
at Nethereum.JsonRpc.WebSocketStreamingClient.StreamingWebSocketClient.SendRequestAsync(RpcRequestMessage request, IRpcStreamingResponseHandler requestResponseHandler, String route)
at Nethereum.JsonRpc.WebSocketStreamingClient.StreamingWebSocketClient.SendRequestAsync(RpcRequest request, IRpcStreamingResponseHandler requestResponseHandler, String route)

@yaeszlo
Copy link

yaeszlo commented May 6, 2023

I have the same issue. No one able to help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants