Comments (8)
from javaphoenixclient.
In my case there is one requirement:
The WS connection has to be open no matter what as long as users did not terminate it by closing the app/screen.
So I do try to reconnect on every error.
from javaphoenixclient.
@dsrees I went through the code and here is what I found:
- I think you are closing the WS with wrong error when the heartbeat times out. Here you should probably pass
WS_CLOSE_SOCKET_EXCEPTION
if you want to trigger reconnectTimer. - The next problem is in the same line. You are calling
this.connection?.disconnect(...)
but this basically tries to call.close(...)
on the OkHttp Websocket. This does not work because the WS is already closed so no callback will be invoked.
I've been able to reproduce this problem using android emulator and Network Link Conditioner
On a side note. I was a bit confused when I saw this . Don't you think it is strange that this is in a Transport
class just to trigger reconnectTimer in the Socket
when all of the reconnection logic is in that class. Is there any reason why this is not handled in the Socket?
from javaphoenixclient.
One more thing. The Socket.reconnectTimer
will be scheduled only once. Because it is never scheduled again after its callback is invoked. This could be simply fixed by scheduling it here.
The one thing I'm not sure about is how it will work with the Channel.rejoinTimer
. This one is being scheduled properly but if the connection is dropped it won't be able to reestablish the WS connection.
WDYT?
from javaphoenixclient.
@AdamGrzybkowski Thanks for digging into this! It's appreciated. I'll be able to look into this more this weekend
from javaphoenixclient.
Made a few changes over the weekend. Need to update the tests to match. Will update when I get closer to fixing these up.
from javaphoenixclient.
I've resolved the issues regarding the heartbeat timing out and made some changes to the Transport
layer to better mimic the JS websocket protocol.
Leaving this issue open since I'll still need to investigate the reconnectTimer
only being scheduled once
from javaphoenixclient.
reconnectTimer
will be scheduled each time the connection is closed. Changes will be available in the next release
from javaphoenixclient.
Related Issues (20)
- NPE in trigger() HOT 4
- Question about the heartbeat HOT 6
- Websocket is automatically reconnected event when intentionally closed HOT 2
- Leaking bindings when the channel reply times out? HOT 3
- Lots of Timers created HOT 2
- ReconnectAfterMs is too big HOT 1
- Downgrade OKhttp to 3.12.2 HOT 1
- Heartbeat seems to be sent only once (instead of every x seconds) HOT 2
- Decoding message payloads HOT 2
- ConcurrentModificationException crash HOT 3
- java.util.ConcurrentModificationException HOT 4
- JSON serialization defaults modify property names HOT 2
- jcenter shutdown - February 2022 HOT 3
- Message.payload marked as non-nullable but can be null HOT 7
- Tries to reconnect with invalid token HOT 3
- Leaving channel causes timeout HOT 5
- `unmatched topic` after reconnect HOT 1
- Issue with AGP v8.0.0 R8 minification HOT 1
- Release 1.1.3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javaphoenixclient.