| | |
| | | package com.flightfeather.obd.socket |
| | | |
| | | import io.netty.bootstrap.ServerBootstrap |
| | | import io.netty.buffer.ByteBuf |
| | | import io.netty.buffer.Unpooled |
| | | import io.netty.channel.ChannelInitializer |
| | | import io.netty.channel.ChannelOption |
| | | import io.netty.channel.nio.NioEventLoopGroup |
| | | import io.netty.channel.socket.nio.NioServerSocketChannel |
| | | import io.netty.channel.socket.nio.NioSocketChannel |
| | | import io.netty.handler.codec.DelimiterBasedFrameDecoder |
| | | import io.netty.handler.codec.bytes.ByteArrayDecoder |
| | | import io.netty.handler.codec.bytes.ByteArrayEncoder |
| | | import io.netty.handler.codec.string.StringDecoder |
| | |
| | | p0?.pipeline() |
| | | // ?.addLast("decoder", StringDecoder()) |
| | | // ?.addLast("encoder", StringEncoder()) |
| | | ?.addLast(ByteArrayDecoder()) |
| | | ?.addLast(ByteArrayEncoder()) |
| | | ?.addLast(ObdByteDataDecoder()) |
| | | ?.addLast(ServerHandler()) |
| | | } |
| | | }) |