Kucoin / kucoin-java-sdk

MIT License
89 stars 77 forks source link

WS api quickly running into issues. #38

Closed Swoorup closed 4 months ago

Swoorup commented 3 years ago

I quickly run into exception such as follows when using the ws client.

    val kucoinPublicWSClient = builder.buildPublicWSClient()
    kucoinPublicWSClient.onMatchExecutionData(trade => println(trade), "XRP-USDT")
03:08:58.050 [OkHttp https://push-private.kucoin.com/...] ERROR c.k.s.w.l.KucoinPublicWebsocketListener - Error on private socket
java.io.EOFException: null
        at okio.RealBufferedSource.require(RealBufferedSource.java:61)
        at okio.RealBufferedSource.readByte(RealBufferedSource.java:74)
        at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.java:117)
        at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:101)
        at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:274)
        at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:214)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:206)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Parker7123 commented 3 years ago

41 resolves this

denistorresan commented 2 years ago

Hi, please try to apply my PR https://github.com/Kucoin/kucoin-java-sdk/pull/56

Wayruha commented 1 year ago

@denistorresan, great answer, thanks!