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

UserData socket closes every 2 minutes #496

Open
jokaorgua opened this issue Jul 22, 2023 · 2 comments
Open

UserData socket closes every 2 minutes #496

jokaorgua opened this issue Jul 22, 2023 · 2 comments

Comments

@jokaorgua
Copy link

jokaorgua commented Jul 22, 2023

Hello. I have a strange issue with UserData websocket
I start it like this

for{
     futures.WebsocketKeepalive = true
    doneC, _, err := futures.WsUserDataServe(listenKey, userDataEventHandler, errorDataEventHandler)
    <-doneC
}

when I run it from my laptop everything is ok.
But when I try to run from server I get disconnects every 2 minutes. (error in console (*net.OpError)(0xc0004a2050)(read tcp XXX.XXX.XXX.XXX:36094->13.112.178.104:443: use of closed network connection))

Any help and ideas would be appreciated.

P.S. I do not see a way to send 'ping-pong' by requesting balance through UserDataStream ws connection (https://binance-docs.github.io/apidocs/futures/en/#websocket-user-data-request)

@jokaorgua
Copy link
Author

the most interesting thing that I've tried from another server (different hoster, different location) and it works okay like from laptop

@jokaorgua
Copy link
Author

so after a huge amount of tests I've figured out that binance has some kind of problems with vultr japan DC (vultr is my hoster). It closes connection after 2-3 minutes since the last data timestamp sent through this connection.

So the ability to request balance or account data through UserDataStream would be wonderful. This will keep connection alive.

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

1 participant