Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

User data stream premature closing #4

Closed
octn opened this issue Dec 16, 2017 · 3 comments
Closed

User data stream premature closing #4

octn opened this issue Dec 16, 2017 · 3 comments

Comments

@octn
Copy link

octn commented Dec 16, 2017

Hi, I am using the provided example (UserDtaStremExample) to listen to order statuses for a specific user. But when I open a user data stream I can only get order statuses for a few minutes, then it stops reporting orders. According to binance documentation the user data stream should remain open for 60 minutes unless a keep alive message is sent. I experimented sending keep alive requests every 2 minutes but I still get the same problem.

@octn
Copy link
Author

octn commented Jan 15, 2018

Hi, I am still having the same issue. Can anyone try and see whether it's working or not? I can get order update events for about 1-2 minutes than it goes silent.

public static void main(String[] args) 
{
	BinanceApiClientFactory factory = BinanceApiClientFactory.newInstance(key, secret);
	BinanceApiRestClient client = factory.newRestClient();
	String listenKey = client.startUserDataStream();
	BinanceApiWebSocketClient webSocketClient = factory.newWebSocketClient();

	webSocketClient.onUserDataUpdateEvent(listenKey, response ->
	{
		if (response.getEventType() == UserDataUpdateEventType.ACCOUNT_UPDATE)
		{
			AccountUpdateEvent accountUpdateEvent = response.getAccountUpdateEvent();
			System.out.println(accountUpdateEvent.getBalances());
		}
		else
		{
			OrderTradeUpdateEvent orderTradeUpdateEvent = response.getOrderTradeUpdateEvent();
			// Print details about an order/trade
			System.out.println(orderTradeUpdateEvent);
		}
	});
	System.out.println("Waiting for events...");
}

@alicanalbayrak
Copy link

I have the same problem, did you find any solution to this ?

@joaopsilva
Copy link
Member

Fixed in 71556ef

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants