Expose the isInputOpen() method in CoreSession interface.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
38a2d04d67
commit
d3dfe353be
|
@ -110,6 +110,11 @@ public interface CoreSession extends OutgoingFrames, Configuration
|
|||
*/
|
||||
SocketAddress getRemoteAddress();
|
||||
|
||||
/**
|
||||
* @return True if the websocket is open inbound
|
||||
*/
|
||||
boolean isInputOpen();
|
||||
|
||||
/**
|
||||
* @return True if the websocket is open outbound
|
||||
*/
|
||||
|
@ -253,6 +258,12 @@ public interface CoreSession extends OutgoingFrames, Configuration
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInputOpen()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOutputOpen()
|
||||
{
|
||||
|
|
|
@ -183,6 +183,12 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab
|
|||
return getConnection().getEndPoint().getRemoteSocketAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInputOpen()
|
||||
{
|
||||
return sessionState.isInputOpen();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOutputOpen()
|
||||
{
|
||||
|
@ -416,8 +422,10 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab
|
|||
{
|
||||
if (!demanding)
|
||||
throw new IllegalStateException("FrameHandler is not demanding: " + this);
|
||||
|
||||
if (!sessionState.isInputOpen())
|
||||
throw new IllegalStateException("FrameHandler input not open: " + this);
|
||||
|
||||
connection.demand(n);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue