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

Переподписка #2

Open
leodev87 opened this issue Nov 8, 2021 · 1 comment
Open

Переподписка #2

leodev87 opened this issue Nov 8, 2021 · 1 comment

Comments

@leodev87
Copy link

leodev87 commented Nov 8, 2021

Приветствую.
При получении "java.io.EOFException: null" падает сокет переподключается, но не восстанавливает подписки. Как это отслеживать и переподписываться?

021-11-08 09:16:49.350 ERROR 23192 --- [.tinkoff.ru/...] c.g.g.t.s.streaming.StreamingService : WebSocket failure, trying to reconnect

java.io.EOFException: null
at okio.RealBufferedSource.require(RealBufferedSource.java:65) ~[okio-1.17.2.jar:na]
at okio.RealBufferedSource.readByte(RealBufferedSource.java:78) ~[okio-1.17.2.jar:na]
at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.java:117) ~[okhttp-3.14.9.jar:na]
at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:101) ~[okhttp-3.14.9.jar:na]
at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:273) ~[okhttp-3.14.9.jar:na]
at okhttp3.internal.ws.RealWebSocket$1.onResponse(RealWebSocket.java:209) ~[okhttp-3.14.9.jar:na]
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174) [okhttp-3.14.9.jar:na]
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) [okhttp-3.14.9.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]

@DmitryTsybulkin
Copy link

Привет! Я бы предложил вариант метода restore(), похожий на реализованный в официальном sdk к open-api: https://github.com/Tinkoff/invest-openapi-java-sdk/blob/493f9d83c4fe53553ed72f39f016bd0fed7c0b4f/sdk-java8/src/main/java/ru/tinkoff/invest/openapi/okhttp/StreamingContextImpl.java#L89

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

No branches or pull requests

2 participants