You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Nettosphere 2.4.10 with Atmosphere 2.4.24. I need to close Atmosphere resource on some conditions, but webSocket.isOpen() call inside of AtmosphereResourceImpl.close() method fails with NullPointerException.
@Override
public void close() throws IOException {
event.setCloseByApplication(true);
notifyListeners();
cancel();
if (webSocket != null && webSocket.isOpen()) {
webSocket.close();
}
}
NettyWebSocket implementation of WebSocket is used. isOpen() method calls this.channel.isOpen(), but channel field is set to null after cancel() execution. After debugging I found that the reason is a change in org.atmosphere.nettosphere.BridgeRuntime.channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) method. It calls webSocket.recycle() which sets channel field to null. Looks like it was added in version 2.4.8.
The text was updated successfully, but these errors were encountered:
I use Nettosphere 2.4.10 with Atmosphere 2.4.24. I need to close Atmosphere resource on some conditions, but
webSocket.isOpen()
call inside ofAtmosphereResourceImpl.close()
method fails with NullPointerException.NettyWebSocket implementation of WebSocket is used.
isOpen()
method callsthis.channel.isOpen()
, but channel field is set tonull
aftercancel()
execution. After debugging I found that the reason is a change inorg.atmosphere.nettosphere.BridgeRuntime.channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
method. It callswebSocket.recycle()
which sets channel field to null. Looks like it was added in version 2.4.8.The text was updated successfully, but these errors were encountered: