1

netty a proxy を使用して実装する正しい方法は何ですか?ただし、パイプラインの段階でのみです。たとえば、`

@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();
          }
        });
  }`

currentTimeMillis API を使用して現在の Date を取得する代わりに、別のサーバーに非同期リクエストを発行し、結果を取得して、パイプラインの次のステップに進みます。前もって感謝します

4

0 に答える 0