我的管道没有按预期工作
public class DataServerInitializer extends ChannelInitializer<SocketChannel> {
@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
socketChannel.pipeline().addLast(new ProtobufDecoder(Command.CommandMessage.getDefaultInstance()));
socketChannel.pipeline().addLast(new ProtobufDecoder(Data.DataMessage.getDefaultInstance()));
socketChannel.pipeline().addLast(new ProtobufEncoder());
socketChannel.pipeline().addLast(new CommandHandler());
socketChannel.pipeline().addLast(new DataHandler());
}
}
DataHandler 被完全忽略
您能更详细地描述一下吗?例如 DataHandler 是入站还是出站或其他详细信息?