diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java index 9646f514187..68c63ddf935 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java @@ -400,12 +400,14 @@ public class WebSocketSession extends ContainerLifeCycle implements Session, Web // confirmed close of local endpoint notifyClose(close.getStatusCode(),close.getReason()); break; - case OPEN: + case CONNECTED: // notify session listeners for (SessionListener listener : sessionListeners) { try { + if (LOG.isDebugEnabled()) + LOG.debug("{}.onSessionOpen()", listener.getClass().getSimpleName()); listener.onSessionOpened(this); } catch (Throwable t) @@ -435,7 +437,7 @@ public class WebSocketSession extends ContainerLifeCycle implements Session, Web // Connect remote remote = new WebSocketRemoteEndpoint(connection,outgoingHandler,getBatchMode()); - + // Open WebSocket websocket.openSession(this); diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/IOState.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/IOState.java index bcd172cf938..de75cecc0c2 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/IOState.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/IOState.java @@ -250,6 +250,9 @@ public class IOState synchronized (this) { closeInfo = close; + + // Turn off further output + outputAvailable = false; boolean in = inputAvailable; boolean out = outputAvailable; @@ -257,9 +260,7 @@ public class IOState { closeHandshakeSource = CloseHandshakeSource.LOCAL; } - out = false; - outputAvailable = false; - + LOG.debug("onCloseLocal(), input={}, output={}",in,out); if (!in && !out) @@ -319,6 +320,9 @@ public class IOState } closeInfo = close; + + // turn off further input + inputAvailable = false; boolean in = inputAvailable; boolean out = outputAvailable; @@ -326,8 +330,6 @@ public class IOState { closeHandshakeSource = CloseHandshakeSource.REMOTE; } - in = false; - inputAvailable = false; if (LOG.isDebugEnabled()) LOG.debug("onCloseRemote(), input={}, output={}",in,out);