use of com.generallycloud.baseio.component.SocketChannel 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);
}
Aggregations