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

Creating user data stream #57

Open
gitkornel opened this issue Apr 8, 2021 · 3 comments
Open

Creating user data stream #57

gitkornel opened this issue Apr 8, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@gitkornel
Copy link

gitkornel commented Apr 8, 2021

Hello, I've been wondering how can you create a user data listen stream?

There is no example and quite didn't understand the code.

What I came up to (but doesn't compile neither works):

SomeFunctor ws_stream_read{};
std::string cust_stream = "fapi/v1/listenKey";
std::thread t1(&FuturesClientUSDT::stream_userStream<SomeFunctor>, cust_stream, std::ref(ws_stream_read.msg_buffer), std::ref(ws_stream_read));
t1.join();

Any ideas?

Best Regards.

@flashnuke
Copy link
Owner

You are attempting to send a custom stream name into a userStream method that is not a custom stream.
Also, in general, if you do want to start a user stream by using the custom stream method, the name should be in this case the listen key.

I've created the following example to illustrate how to start a user stream - https://github.com/adanikel/BinanceExtensionCPP/blob/master/examples/futures_user_stream.cpp

tested and works for me (futures account)

let me know if that helps @gitkornel

@gitkornel
Copy link
Author

You are attempting to send a custom stream name into a userStream method that is not a custom stream.
Also, in general, if you do want to start a user stream by using the custom stream method, the name should be in this case the listen key.

I've created the following example to illustrate how to start a user stream - https://github.com/adanikel/BinanceExtensionCPP/blob/master/examples/futures_user_stream.cpp

tested and works for me (futures account)

let me know if that helps @gitkornel

Hello, it doesn't do anything, doesn't print.

I copied the exact code from the example.

@flashnuke flashnuke self-assigned this Apr 9, 2021
@flashnuke flashnuke added the bug Something isn't working label Apr 9, 2021
Repository owner locked and limited conversation to collaborators Apr 9, 2021
@flashnuke
Copy link
Owner

If you copied the exact snippet it should work.

The user stream only pushes updates when there are updates to push, such as new orders.

Try cancelling / opening a new FUTURES USDT order and see if an update goes through. Also make sure the key is supporting futures trading.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants