Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用netty.io在管道外发出火灾请求_Java_Netty_Pipelining - Fatal编程技术网

Java 使用netty.io在管道外发出火灾请求

Java 使用netty.io在管道外发出火灾请求,java,netty,pipelining,Java,Netty,Pipelining,使用netty代理实现的正确方法是什么,但只是在管道中的一个阶段 例如 ` 而不是使用currentTimeMillis API获取当前日期, 向另一台服务器发出异步请求,获取结果,然后继续管道的下一步。 提前谢谢 @Override public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) { Channel ch = e.getChannel(); Chann

使用netty代理实现的正确方法是什么,但只是在管道中的一个阶段 例如 `

而不是使用currentTimeMillis API获取当前日期, 向另一台服务器发出异步请求,获取结果,然后继续管道的下一步。 提前谢谢

@Override
  public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) {
        Channel ch = e.getChannel();

        ChannelBuffer time = ChannelBuffers.buffer(4);
      time.writeInt((int) (System.currentTimeMillis() / 1000L + 2208988800L));

      ChannelFuture f = ch.write(time);

     f.addListener(new ChannelFutureListener() {
            public void operationComplete(ChannelFuture future) {
              Channel ch = future.getChannel();
                ch.close();
          }
        });
  }`