472082 - isOpen returns true on CLOSING Connection

+ Minor tweak to test for isOutputAvailable() instead of connection
  state.
This commit is contained in:
Joakim Erdfelt 2015-08-27 12:52:52 -07:00
parent ef067b2624
commit 11b5d320f8
1 changed files with 2 additions and 4 deletions

View File

@ -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