Package etch.util.core.nio

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


    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

    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

    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

    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.