diff --git a/src/main/java/com/seailz/discordjar/gateway/GatewayFactory.java b/src/main/java/com/seailz/discordjar/gateway/GatewayFactory.java index 8fc06554..8c6752dc 100644 --- a/src/main/java/com/seailz/discordjar/gateway/GatewayFactory.java +++ b/src/main/java/com/seailz/discordjar/gateway/GatewayFactory.java @@ -169,7 +169,7 @@ public boolean attemptReconnect(CloseStatus status) { switch (status.getCode()) { case 1012: return true; - case 1011, 1015: + case 1011, 1015, 1003: return false; case 4000: if (debug) logger.info("[Gateway] Connection was closed due to an unknown error. Will attempt reconnect."); @@ -407,7 +407,7 @@ public void killConnection() throws IOException { heartbeatManager = null; readyForMessages = false; // close connection - if (getSocket() != null && getSocket().getWs() != null) getSocket().getWs().close(CloseStatus.TLS_HANDSHAKE_FAILURE.getCode(), "Going away"); + if (getSocket() != null && getSocket().getWs() != null) getSocket().getWs().close(CloseStatus.NOT_ACCEPTABLE.getCode(), "Going away"); if (debug) { logger.info("[DISCORD.JAR - DEBUG] Connection closed.");