Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Ping/Pong exception in Depth websocket #202

@tomastoth

Description

@tomastoth

Hello guys,

when I am opening an onDepthEvent websocket on many pairs(all btc pairs), I start getting this error

java.net.SocketTimeoutException: sent ping but didn't receive pong within 20000ms (after 0 successful ping/pongs)

When checking binance official websocket api which says:
The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed.

I though the Ping/Pong should be sent every 3 min?
When checking BinanceApiServiceGenerator the httpClient is created:
Dispatcher dispatcher = new Dispatcher(); dispatcher.setMaxRequestsPerHost(500); dispatcher.setMaxRequests(500); sharedClient = new OkHttpClient.Builder() .dispatcher(dispatcher) .pingInterval(20, TimeUnit.SECONDS) .build();
Doesnt that mean its trying to ping and receive a pong from server within 20 seconds?
Maybe thats why the error is happening?

Thanks for any tips!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions