use of com.generallycloud.baseio.connector.ChannelConnector in project baseio by generallycloud.
the class ExitExecutable method exec.
@Override
public CmdResponse exec(CommandContext context, HashMap<String, String> params) {
CmdResponse response = new CmdResponse();
ChannelConnector connector = getClientConnector(context);
if (connector == null) {
response.setResponse("请先登录!");
return response;
}
// FIXME logout
// connector.logout();
CloseUtil.close(connector);
setMessageBrowser(context, null);
setClientConnector(context, null);
response.setContinue(false);
response.setResponse("系统退出!");
return response;
}
use of com.generallycloud.baseio.connector.ChannelConnector in project baseio by generallycloud.
the class ClientHttpFuture method updateWebSocketProtocol.
@Override
public void updateWebSocketProtocol() {
ChannelConnector connector = (ChannelConnector) context.getChannelService();
UnsafeSocketSession session = (UnsafeSocketSession) connector.getSession();
SocketChannel channel = session.getSocketChannel();
channel.setProtocolFactory(WebSocketProtocolFactory.WS_PROTOCOL_FACTORY);
channel.setProtocolDecoder(WebSocketProtocolFactory.WS_PROTOCOL_DECODER);
channel.setProtocolEncoder(WebSocketProtocolFactory.WS_PROTOCOL_ENCODER);
}
use of com.generallycloud.baseio.connector.ChannelConnector in project baseio by generallycloud.
the class DisconnectExecutable method exec.
@Override
public CmdResponse exec(CommandContext context, HashMap<String, String> params) {
CmdResponse response = new CmdResponse();
ChannelConnector connector = getClientConnector(context);
if (connector == null) {
response.setResponse("请先登录!");
return response;
}
// FXIME logout
// connector.logout();
CloseUtil.close(connector);
setMessageBrowser(context, null);
setClientConnector(context, null);
response.setResponse("已断开连接!");
return response;
}
Aggregations