Search in sources :

Example 1 with WebSocketFrameTranslator

use of org.neo4j.bolt.transport.pipeline.WebSocketFrameTranslator in project neo4j by neo4j.

the class TransportSelectionHandler method switchToWebsocket.

private void switchToWebsocket(ChannelHandlerContext ctx) {
    ChannelPipeline p = ctx.pipeline();
    memoryTracker.allocateHeap(HTTP_SERVER_CODEC_SHALLOW_SIZE + HTTP_OBJECT_AGGREGATOR_SHALLOW_SIZE + WEB_SOCKET_SERVER_PROTOCOL_HANDLER_SHALLOW_SIZE + WEB_SOCKET_FRAME_AGGREGATOR_SHALLOW_SIZE + WebSocketFrameTranslator.SHALLOW_SIZE + ProtocolHandshaker.SHALLOW_SIZE);
    p.addLast(new HttpServerCodec(), new HttpObjectAggregator(MAX_WEBSOCKET_HANDSHAKE_SIZE), new WebSocketServerProtocolHandler("/", null, false, MAX_WEBSOCKET_FRAME_SIZE), new WebSocketFrameAggregator(MAX_WEBSOCKET_FRAME_SIZE), new WebSocketFrameTranslator(), newHandshaker());
    p.remove(this);
}
Also used : WebSocketFrameAggregator(io.netty.handler.codec.http.websocketx.WebSocketFrameAggregator) HttpObjectAggregator(io.netty.handler.codec.http.HttpObjectAggregator) HttpServerCodec(io.netty.handler.codec.http.HttpServerCodec) WebSocketServerProtocolHandler(io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler) WebSocketFrameTranslator(org.neo4j.bolt.transport.pipeline.WebSocketFrameTranslator) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

ChannelPipeline (io.netty.channel.ChannelPipeline)1 HttpObjectAggregator (io.netty.handler.codec.http.HttpObjectAggregator)1 HttpServerCodec (io.netty.handler.codec.http.HttpServerCodec)1 WebSocketFrameAggregator (io.netty.handler.codec.http.websocketx.WebSocketFrameAggregator)1 WebSocketServerProtocolHandler (io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler)1 WebSocketFrameTranslator (org.neo4j.bolt.transport.pipeline.WebSocketFrameTranslator)1