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

Websocket connection stability #40

Open
mengoudis opened this issue Sep 16, 2022 · 6 comments
Open

Websocket connection stability #40

mengoudis opened this issue Sep 16, 2022 · 6 comments

Comments

@mengoudis
Copy link

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.

@revilwang
Copy link
Collaborator

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

@mengoudis
Copy link
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).

@khunspoonzi
Copy link

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
Copy link
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.

@khunspoonzi
Copy link

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
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants