Closed 1037390459 closed 5 years ago
I'm adding heart-beat support. Will you accept a pull request and do a new release?
Yes of course
Hi,
I've found a trick to avoid server timeout disconnect on missing pong reply on ping frame from the server. Only work with "Stomp.ConnectionProvider.OKHTTP" and the server heartbeat set.
mStompClient.setHeartbeat(30*1000);
I've modified the class "OkHttpConnectionProvider" on line 67, when the heartbeat from server is received, like this:
@Override public void onMessage(WebSocket webSocket, String text) { if (text.equals("\n")) { Log.d(TAG, "RECEIVED HEARTBEAT"); rawSend("\n"); } else emitMessage(text); }
On each heartbeat from the server, i respond with a raw frame "\n".
Work with RabbitMq and WebStomp plugin.
@jdupont22 nice trick :) usually the server and client heart-beat are set to same value.
Just waiting for your review and/or merge.
Hey, make an issue on the downstream explaining what you want with as much detail as you can manage, and we'll start looking into our options for making this work well.