Examples of remoteAddress()


Examples of io.netty.channel.Channel.remoteAddress()

            HttpResponse res = new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.BAD_REQUEST);
            ChannelFuture f = channel.writeAndFlush(res);
            f.addListener(ChannelFutureListener.CLOSE);
            req.release();
            log.warn("Blocked wrong socket.io-context request! url: {}, ip: {}", queryDecoder.path(), channel.remoteAddress());
        }
    }

}
View Full Code Here

Examples of io.netty.channel.Channel.remoteAddress()

                    && !queryDecoder.path().startsWith(connectPath)) {
                HttpResponse res = new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.BAD_REQUEST);
                ChannelFuture f = channel.write(res);
                f.addListener(ChannelFutureListener.CLOSE);
                req.release();
                log.warn("Blocked wrong request! url: {}, ip: {}", queryDecoder.path(), channel.remoteAddress());
                return;
            }
            if (queryDecoder.path().equals(connectPath)) {
                String origin = req.headers().get(HttpHeaders.Names.ORIGIN);
                authorize(channel, origin, queryDecoder.parameters());
View Full Code Here

Examples of io.netty.channel.socket.DatagramPacket.remoteAddress()

            nioData = ByteBuffer.allocate(dataLen);
            data.getBytes(data.readerIndex(), nioData);
            nioData.flip();
        }

        final int writtenBytes = javaChannel().send(nioData, packet.remoteAddress());

        final SelectionKey key = selectionKey();
        final int interestOps = key.interestOps();
        if (writtenBytes <= 0 && dataLen > 0) {
            // Did not write a packet.
View Full Code Here

Examples of io.netty.channel.socket.DatagramPacket.remoteAddress()

        DatagramPacket p = (DatagramPacket) buf.poll();

        try {
            ByteBuf data = p.data();
            int length = data.readableBytes();
            InetSocketAddress remote = p.remoteAddress();
            if (remote != null) {
                tmpPacket.setSocketAddress(remote);
            }
            if (data.hasArray()) {
                tmpPacket.setData(data.array(), data.arrayOffset() + data.readerIndex(), length);
View Full Code Here

Examples of io.vertx.core.net.NetSocket.remoteAddress()

      assertEquals("127.0.0.1", addr.hostAddress());
    }).listen(ar -> {
      assertTrue(ar.succeeded());
      vertx.createNetClient(new NetClientOptions()).connect(1234, "localhost", result -> {
        NetSocket socket = result.result();
        SocketAddress addr = socket.remoteAddress();
        assertEquals("127.0.0.1", addr.hostAddress());
        assertEquals(addr.hostPort(), 1234);
        testComplete();
      });
    });
View Full Code Here

Examples of org.apache.hadoop.oncrpc.RpcInfo.remoteAddress()

      reply.write(out);
    }

    ChannelBuffer buf = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap()
        .buffer());
    RpcResponse rsp = new RpcResponse(buf, info.remoteAddress());
    RpcUtil.sendRpcResponse(ctx, rsp);
  }

  @Override
  public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
View Full Code Here

Examples of play.mvc.Http.Request.remoteAddress()

 
  private ALogger accessLogger = Logger.of("access");
 
  public F.Promise<Result> call(Http.Context ctx) throws Throwable {
    final Request request = ctx.request();
    accessLogger.info("method=" + request.method() + " uri=" + request.uri() + " remote-address=" + request.remoteAddress());
   
    return delegate.call(ctx);
  }
}
//#logging-pattern-mix
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.