Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Websocket connection stability #40

Open

Description

@mengoudis

Hello everyone.

I have noticed many frequent random disconnects from the Gate.io websocket server.
Everything is stable when connecting to the websocket servers of 3 other major exchanges (and the code can run for days) but the connection to Gate.io is unstable.
It disconnects with no apparent reason, it does not seem to close the connection, it seems more like just sitting idle and not sending any updates.
Ping / pong protocol is respected with the connection (even though their documentation is vague about it).

Do you have any specific advice about how to handle Gate.io websocket connections? Maybe something that is not apparent in the docs or anything else?

Thank you in advance.

Activity

  1. revilwang commented on Sep 16, 2022

    @revilwang
    Collaborator

    Could you provide the server endpoint you’re connecting to? And some disconnection logs will also be great help!

  2. mengoudis commented on Sep 16, 2022

    @mengoudis
    Author

    Hi, thanks for the quick reply.

    I connect to wss://api.gateio.ws/ws/v4/ and I send a subscription message like {"time": '.time().', "channel": "spot.order_book", "event": "subscribe", "payload": ["tt_usdt", "100", "100ms"]}.

    I am using the "ratchet/pawl": "^0.3.5" library to run my php code as a websocket client.

    I do not have any network logs, at least my code does not keep any, but I am sure something is not right because the "onclose" event handler that triggers when a connection is closed by the other exchanges, for example when I do not send a ping/pong, does not trigger at all for Gate.io. I am not even sure if the connection is dropped, I just do not get any data for long periods of time (and I assume the connection was closed or something).

  3. khunspoonzi commented on Apr 15, 2024

    @khunspoonzi

    Did you ever get this resolved? @mengoudis

    I've observed very similar behavior on my side as well. Seemingly the connection is not broken but then for a period it seems like I completely stop receiving deltas altogether. And then after several minutes, they resume streaming in.

    @revilwang Interested to get your input on this as well since you have some great example implementations on your profile. Has this ever been a known issue for you at any point?

  4. mengoudis commented on Apr 17, 2024

    @mengoudis
    Author

    nope... did not end up fixing it. And because we do not currently use gate.io very much, we did not focus on this.

    but it will need to get fixed at some point.

  5. khunspoonzi commented on Apr 17, 2024

    @khunspoonzi

    Noted thanks. I'll follow up if I do end up figuring it out. Would still love to get input from @revilwang in case this issue has been raised elsewhere as well.

  6. revilwang commented on Apr 18, 2024

    @revilwang
    Collaborator

    We've been fixing server issues constantly. As this is the repo of client SDK, I would suggest sending any server related issues with detailed requests to the official support entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions