runelite-client: reconnect if connection is closed.

This commit is contained in:
Adam
2017-05-14 19:51:38 -04:00
parent cf4e9fab1d
commit 7af13c6d99

View File

@@ -83,6 +83,13 @@ public class WSClient extends WebSocketListener implements AutoCloseable
public void send(WebsocketMessage message)
{
if (webSocket == null)
{
logger.debug("Reconnecting to server");
connect();
}
String json = gson.toJson(message, WebsocketMessage.class);
webSocket.send(json);
@@ -92,7 +99,7 @@ public class WSClient extends WebSocketListener implements AutoCloseable
@Override
public void close()
{
webSocket.close(0, null);
webSocket.close(1000, null);
}
@Override