diff options
author | Joakim Erdfelt | 2015-08-27 19:52:52 +0000 |
---|---|---|
committer | Joakim Erdfelt | 2015-08-27 19:52:52 +0000 |
commit | 11b5d320f804836604f31dabd032324e039101d6 (patch) | |
tree | a8403b1a3785523cb7396fedbc3f4aaeae190b6b /jetty-websocket | |
parent | ef067b26242baf07ee8f9f3dbde85329db0c20a0 (diff) | |
download | org.eclipse.jetty.project-11b5d320f804836604f31dabd032324e039101d6.tar.gz org.eclipse.jetty.project-11b5d320f804836604f31dabd032324e039101d6.tar.xz org.eclipse.jetty.project-11b5d320f804836604f31dabd032324e039101d6.zip |
472082 - isOpen returns true on CLOSING Connection
+ Minor tweak to test for isOutputAvailable() instead of connection
state.
Diffstat (limited to 'jetty-websocket')
-rw-r--r-- | jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java | 6 |
1 files changed, 2 insertions, 4 deletions
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 9064526595..3654c59c75 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 @@ -242,14 +242,12 @@ public class WebSocketSession extends ContainerLifeCycle implements Session, Inc @Override public RemoteEndpoint getRemote() { - ConnectionState state = connection.getIOState().getConnectionState(); - - if ((state == ConnectionState.OPEN) || (state == ConnectionState.CONNECTED)) + if (connection.getIOState().isOutputAvailable()) { return remote; } - throw new WebSocketException("RemoteEndpoint unavailable, current state [" + state + "], expecting [OPEN or CONNECTED]"); + throw new WebSocketException("RemoteEndpoint unavailable, outgoing connection not open"); } @Override |