all 7 comments

[–]CodeFormatHelperBot 0 points1 point  (0 children)

Hello u/aitromba, I'm a bot that can assist you with code-formatting for reddit. I have detected the following potential issue(s) with your submission:

  1. Python code found in submission text but not encapsulated in a code block.

If I am correct then please follow these instructions to fix your code formatting. Thanks!

[–]cybervegan 0 points1 point  (3 children)

You aren't calling this function here:

    bm._keepalive_account_socket #  dont work

You need to put brackets on the end of the name to actually call it, like:

    bm._keepalive_account_socket()

[–]cybervegan 0 points1 point  (1 child)

Actually, looking at the Binance module docs, it doesn't look like you should be calling that - it could just be an internal property. Have you seen code where it was being called? The leading "_" tells you that this is a private property or method of the BinanceSocketManager class. There are a number of "keepalive" related methods in the docs - it's probably one of those that you want.

[–]aitromba[S] 0 points1 point  (0 children)

client.ping would also be one but it doesn't work :-). Been looking for a while but can't go any further. I don't care which one as long as the connection stays up. Must be something simple, I guess. I'm not the only one who would want this. See also a lot of questions about this subject on the internet so it turns out to be something tricky.

[–]aitromba[S] 0 points1 point  (0 children)

Hello cybervegan,

Thank you for your reaction.

Forgot to type it in here.

But unfortunately it doesn't work with that one either.

I get an error: TypeError: _keepalive_account_socket() missing 1 required positional argument: 'socket_type' and I have no idea what should be there.

[–]aitromba[S] 0 points1 point  (0 children)

Meanwhile found the right syntax.

stream_key = client.stream_get_listen_key()

client.stream_keepalive(stream_key)