Examples of remoteAddress()


Examples of akka.io.Tcp.Connected.remoteAddress()

        log.warning("unknown command failed [{}]", failed.cmd());
      }
    } else
    if (msg instanceof Connected) {
      final Connected conn = (Connected) msg;
      log.info("received connection from [{}]", conn.remoteAddress());
      final ActorRef connection = getSender();
      final ActorRef handler = getContext().actorOf(
          Props.create(handlerClass, connection, conn.remoteAddress()));
      //#echo-manager
      connection.tell(TcpMessage.register(handler,
View Full Code Here

Examples of akka.io.Tcp.Connected.remoteAddress()

    if (msg instanceof Connected) {
      final Connected conn = (Connected) msg;
      log.info("received connection from [{}]", conn.remoteAddress());
      final ActorRef connection = getSender();
      final ActorRef handler = getContext().actorOf(
          Props.create(handlerClass, connection, conn.remoteAddress()));
      //#echo-manager
      connection.tell(TcpMessage.register(handler,
          true, // <-- keepOpenOnPeerClosed flag
          true), getSelf());
      //#echo-manager
View Full Code Here

Examples of akka.io.Tcp.Connected.remoteAddress()

        final InetSocketAddress listen = expectMsgClass(Bound.class).localAddress();
        final ActorRef client = system.actorOf(Props.create(Client.class, listen, getRef()), "client1");
       
        final Connected c1 = expectMsgClass(Connected.class);
        final Connected c2 = expectMsgClass(Connected.class);
        assert c1.localAddress().equals(c2.remoteAddress());
        assert c2.localAddress().equals(c1.remoteAddress());
       
        client.tell(ByteString.fromString("hello"), getRef());
        final ByteString reply = expectMsgClass(ByteString.class);
        assert reply.utf8String().equals("hello");
View Full Code Here

Examples of etch.util.core.nio.Tcp2Connection.remoteAddress()

    assertWhat( What.UP, dh.what );
    assertNull( dh.xsender );
    assertNull( dh.xbuf );
   
//    c.flush();
    assertNotNull( c.remoteAddress() );
    assertNotNull( c.localAddress() );
    assertEquals( c.remoteAddress(), t.socket().getLocalSocketAddress() );
    assertEquals( c.localAddress(), t.socket().getRemoteSocketAddress() );
   
    t.close();
View Full Code Here

Examples of etch.util.core.nio.Tcp2Connection.remoteAddress()

    assertNull( dh.xbuf );
   
//    c.flush();
    assertNotNull( c.remoteAddress() );
    assertNotNull( c.localAddress() );
    assertEquals( c.remoteAddress(), t.socket().getLocalSocketAddress() );
    assertEquals( c.localAddress(), t.socket().getRemoteSocketAddress() );
   
    t.close();
   
    assertWhat( What.DOWN, dh.what );
View Full Code Here

Examples of etch.util.core.nio.Tcp2Connection.remoteAddress()

        "t.local", t.socket().getLocalSocketAddress(),
        "t.remote", t.socket().getRemoteSocketAddress() );
     
      assertWhat( What.UP, dh.what );
     
      assertEquals( t.socket().getLocalSocketAddress(), c.remoteAddress() );
      assertEquals( t.socket().getRemoteSocketAddress(), c.localAddress() );
     
      write( t, i );
      assertWhat( What.DATA, dh.what );
      assertNull( dh.xsender );
View Full Code Here

Examples of etch.util.core.nio.Tcp2Connection.remoteAddress()

        "t.remote", t.socket().getRemoteSocketAddress() );
     
      assertWhat( What.UP, dh.what );
//      Log.report( "up", "c.local", c.localAddress(), "c.remote", c.remoteAddress() );
     
      assertEquals( t.socket().getLocalSocketAddress(), c.remoteAddress() );
      assertEquals( t.socket().getRemoteSocketAddress(), c.localAddress() );
     
      write( t, i );
      assertWhat( What.DATA, dh.what );
      assertNull( dh.xsender );
View Full Code Here

Examples of io.netty.bootstrap.Bootstrap.remoteAddress()

        try {
            Bootstrap b = new Bootstrap();
            b.group(workerGroup);
            b.channel(NioSocketChannel.class);
            b.option(ChannelOption.SO_KEEPALIVE, true);
            b.remoteAddress(HOST, PORT);
            b.handler(new SpdyClientInitializer(sslCtx, httpResponseHandler));

            // Start the client.
            Channel channel = b.connect().syncUninterruptibly().channel();
            System.out.println("Connected to " + HOST + ':' + PORT);
View Full Code Here

Examples of io.netty.bootstrap.Bootstrap.remoteAddress()

            // Configure the client.
            Bootstrap b = new Bootstrap();
            b.group(workerGroup);
            b.channel(NioSocketChannel.class);
            b.option(ChannelOption.SO_KEEPALIVE, true);
            b.remoteAddress(HOST, PORT);
            b.handler(initializer);

            // Start the client.
            Channel channel = b.connect().syncUninterruptibly().channel();
            System.out.println("Connected to [" + HOST + ':' + PORT + ']');
View Full Code Here

Examples of io.netty.bootstrap.Bootstrap.remoteAddress()

            b.channel(NioSocketChannel.class);
           
            b.option(ChannelOption.SO_KEEPALIVE, true);
            b.option(ChannelOption.MESSAGE_SIZE_ESTIMATOR, DefaultMessageSizeEstimator.DEFAULT);
            b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, CONFIG.peerConnectionTimeout());
            b.remoteAddress(host, port);


            p2pHandler.setMsgQueue(messageQueue);
            p2pHandler.setPeerDiscoveryMode(true);
            p2pHandler.activate();
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.