Search in sources :

Example 1 with SocketChannel

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);
}
Also used : SocketChannel(com.generallycloud.baseio.component.SocketChannel) UnsafeSocketSession(com.generallycloud.baseio.component.UnsafeSocketSession) ChannelConnector(com.generallycloud.baseio.connector.ChannelConnector)

Aggregations

SocketChannel (com.generallycloud.baseio.component.SocketChannel)1 UnsafeSocketSession (com.generallycloud.baseio.component.UnsafeSocketSession)1 ChannelConnector (com.generallycloud.baseio.connector.ChannelConnector)1