Better detection of closed client side WS connection (to reconnect if necessary)
This commit is contained in:
parent
20643fec62
commit
f3f616cdca
@ -158,6 +158,7 @@ public abstract class AbstractClientWS implements AbstractWS {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void sendString(String message) throws IOException {
|
public final void sendString(String message) throws IOException {
|
||||||
|
try {
|
||||||
try {
|
try {
|
||||||
synchronized (socket) {
|
synchronized (socket) {
|
||||||
WebSocket ws = socket.get();
|
WebSocket ws = socket.get();
|
||||||
@ -171,6 +172,14 @@ public abstract class AbstractClientWS implements AbstractWS {
|
|||||||
throw ioe;
|
throw ioe;
|
||||||
throw ThrowableUtil.uncheck(ce.getCause(), false);
|
throw ThrowableUtil.uncheck(ce.getCause(), false);
|
||||||
}
|
}
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
synchronized (socket) {
|
||||||
|
socket.set(null);
|
||||||
|
reconnectIfNecessary();
|
||||||
|
}
|
||||||
|
throw ioe;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user