| | |
| | | package com.example.agvcontroller.socket; |
| | | |
| | | import com.example.agvcontroller.protocol.MessageBodyHandler; |
| | | import com.example.agvcontroller.protocol.ProtocolDecoder; |
| | | import com.example.agvcontroller.protocol.ProtocolEncoder; |
| | | |
| | |
| | | .childHandler(new ChannelInitializer<SocketChannel>() { |
| | | @Override |
| | | public void initChannel(SocketChannel ch) throws Exception { |
| | | ch.pipeline().addLast(new NettyServerHandler()).addLast(new ProtocolEncoder()); |
| | | ch.pipeline().addLast(new ProtocolEncoder()) |
| | | .addLast(new ProtocolDecoder(4096)) |
| | | .addLast(new MessageBodyHandler()) |
| | | .addLast(new NettyServerHandler()); |
| | | } |
| | | }) |
| | | // .addLast(new NettyServerHandler()) |