Examples of localAddress()


Examples of akka.io.Tcp.Connected.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.localAddress()

    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.localAddress()

   
//    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 );
    assertNull( dh.xsender );
View Full Code Here

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

        "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 );
      assertNotNull( dh.xbuf );
View Full Code Here

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

     
      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 );
      assertNotNull( dh.xbuf );
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener.localAddress()

    assertTrue( l.isStarted() );

    assertWhat( What.UP, lh.what );
    assertNull( lh.xsocket );

    InetSocketAddress a = (InetSocketAddress) l.localAddress();
    if ( a.getAddress() instanceof Inet6Address )
      assertEquals( "0:0:0:0:0:0:0:0", a.getAddress().getHostAddress().toString() );
    else
      assertEquals( "0.0.0.0", a.getAddress().getHostAddress().toString() );
    assertTrue( a.getPort() > 0 && a.getPort() < 65536 );
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener.localAddress()

    assertTrue( l.isStarted() );

    assertWhat( What.UP, lh.what );
    assertNull( lh.xsocket );

    InetSocketAddress a = (InetSocketAddress) l.localAddress();
    assertEquals( "127.0.0.1", a.getAddress().getHostAddress().toString() );
    assertTrue( a.getPort() > 0 && a.getPort() < 65536 );

    l.stop();
    l.waitDown( TIMEOUT );
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener.localAddress()

    assertTrue( l.isStarted() );

    assertWhat( What.UP, lh.what );
    assertNull( lh.xsocket );

    InetSocketAddress a = (InetSocketAddress) l.localAddress();
    if ( a.getAddress() instanceof Inet6Address )
      assertEquals( "0:0:0:0:0:0:0:0", a.getAddress().getHostAddress().toString() );
    else
      assertEquals( "0.0.0.0", a.getAddress().getHostAddress().toString() );
    assertEquals( 4998, a.getPort() );
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener.localAddress()

    assertTrue( l.isStarted() );

    assertWhat( What.UP, lh.what );
    assertNull( lh.xsocket );

    InetSocketAddress a = (InetSocketAddress) l.localAddress();
    assertEquals( "127.0.0.1", a.getAddress().getHostAddress().toString() );
    assertEquals( 4996, a.getPort() );

    l.stop();
    l.waitDown( TIMEOUT );
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener.localAddress()

    l.setSession( lh );

    l.start();
    l.waitUp( TIMEOUT );

    int port = ((InetSocketAddress) l.localAddress()).getPort();

    int n = 1000;

    for (int i = 0; i < n; i++)
      new Socket( "127.0.0.1", port ).close();
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.