Using okhttp WebSocket as a stomp client will throws an error after about 1 min of inactivity.
java.lang.Exception: java.io.EOFException
This is because that StompProtocolAndroid have not implement heart beat on creating connections, so we have to implement it by ourselves.
Here is an example:
// code to set a scheduled task, I'm sorry for ignoring this part, but I don't know how to do this.
stompClient.send("", "")subscribe(); // send a heart beat
Using okhttp WebSocket as a stomp client will throws an error after about 1 min of inactivity.
This is because that StompProtocolAndroid have not implement heart beat on creating connections, so we have to implement it by ourselves.
Here is an example: