Package akka.io.Tcp

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


    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

        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

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.