webcerebrium / java-binance-api

Java Binance API Client
MIT License
75 stars 37 forks source link

Web Socket - No Output #17

Open spapapan opened 6 years ago

spapapan commented 6 years ago

I am trying to run:

        BinanceSymbol symbol = new BinanceSymbol("ETHBTC");
        Session session = (new BinanceApi()).websocketTrades(symbol, new BinanceWebSocketAdapterAggTrades() {
            @Override
            public void onMessage(BinanceEventAggTrade message) { 
                System.out.println(message.toString());
            }
        });
        try { Thread.sleep(5000); } catch (InterruptedException e) {}
        session.close();

But I don't get any output. There are no errors and the program never stop. Is this somehow my fault?

wcrbrm commented 6 years ago

That just means nothing happened during those 5 seconds on that particular market. Try increasing time interval or even remove the last 2 lines - it will watch market till the user interrupts it

spapapan commented 6 years ago

That's not the case. I have tried it many times and I checked the market. I also tried the other class BinanceWebSocketAdapterDepth but still I don't get anything back.

wcrbrm commented 6 years ago

well, I've double checked the code is valid, I've added it as groovy example and it works for me. May me it is somehow connected with dependencies managed manually like described in your previous ticket