You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 16, 2026. It is now read-only.
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?
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).
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?
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.
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.
Activity
revilwang commentedon Sep 16, 2022
Could you provide the server endpoint you’re connecting to? And some disconnection logs will also be great help!
mengoudis commentedon Sep 16, 2022
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).
khunspoonzi commentedon Apr 15, 2024
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?
mengoudis commentedon Apr 17, 2024
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.
khunspoonzi commentedon Apr 17, 2024
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.
revilwang commentedon Apr 18, 2024
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.