Examples of Tcp2Listener


Examples of etch.util.core.nio.Tcp2Listener

    final Resources resources, final ServerFactory factory )
    throws Exception
  {
    URL u = new URL( uri );

    Transport<SessionListener<SocketChannel>> l = new Tcp2Listener( u,
      resources );

    MySessionListener b = new MySessionListener( l, uri, resources );
    b.setSession( factory );
    return b;
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener

    final Resources resources, final ServerFactory factory )
    throws Exception
  {
    URL u = new URL( uri );

    Transport<SessionListener<SocketChannel>> l = new Tcp2Listener( u,
      resources );

    MySessionListener b = new MySessionListener( l, uri, resources );
    b.setSession( factory );
    return b;
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener

  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void constructor1() throws Exception
  {
    // negative port
    new Tcp2Listener( "tcp://0.0.0.0:-1", r );
  }
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener

  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void constructor2() throws Exception
  {
    // too positive port
    new Tcp2Listener( "tcp://0.0.0.0:65536", r );
  }
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener

  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void constructor3() throws Exception
  {
    // missing port
    new Tcp2Listener( "tcp://0.0.0.0", r );
  }
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener

  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void constructor4() throws Exception
  {
    // negative backlog
    new Tcp2Listener( "tcp://0.0.0.0:0?backlog=-1", r );
  }
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener

  /** @throws Exception */
  @Test
  public void constructor5() throws Exception
  {
    Tcp2Listener l = new Tcp2Listener( "tcp://0.0.0.0:45", r );
    assertEquals( "0.0.0.0", l.getHost() );
    assertEquals( 45, l.getPort() );
    assertEquals( 0, l.getBacklog() );
  }
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener

  /** @throws Exception */
  @Test
  public void constructor6() throws Exception
  {
    Tcp2Listener l = new Tcp2Listener( "tcp://foo:2001?backlog=19", r );
    assertEquals( "foo", l.getHost() );
    assertEquals( 2001, l.getPort() );
    assertEquals( 19, l.getBacklog() );
  }
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener

  @Test
  public void session1() throws Exception
  {
    MyListenerHandler lh = new MyListenerHandler();
   
    Tcp2Listener l = new Tcp2Listener( "tcp://0.0.0.0:0", r );
    l.setSession( lh );
   
    assertSame( lh, l.getSession() );
  }
View Full Code Here

Examples of etch.util.core.nio.Tcp2Listener

  /** @throws Exception */
  @Test
  public void stop1() throws Exception
  {
    // illegal state: not started.
    Tcp2Listener l = new Tcp2Listener( "tcp://0.0.0.0:0", r );
    l.stop();
  }
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.