8cdc1d74cd5a11e5ebac7ae78556d05c2c81bbcb
[ccsdk/apps.git] / sdnr / wireless-transport / code-Carbon-SR1 / apps / websocketmanager / impl / src / main / java / org / opendaylight / mwtn / impl / websocket / WebSocketServerInitializer.java
1 /*
2 * Copyright (c) 2016 Wipro Ltd. and others. All rights reserved.
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
7 */
8
9 package org.opendaylight.mwtn.impl.websocket;
10
11 import io.netty.channel.ChannelInitializer;
12 import io.netty.channel.ChannelPipeline;
13 import io.netty.channel.socket.SocketChannel;
14 import io.netty.handler.codec.http.HttpObjectAggregator;
15 import io.netty.handler.codec.http.HttpServerCodec;
16
17 public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel> {
18         @Override
19         public void initChannel(SocketChannel ch) throws Exception {
20                 ChannelPipeline pipeline = ch.pipeline();
21                 pipeline.addLast("codec-http", new HttpServerCodec());
22                 pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
23                 pipeline.addLast("handler", new WebSocketServerHandler());
24         }
25 }