Package etch.util.core.nio

Examples of etch.util.core.nio.Tcp2Connection


  public DeliveryService newTransport( String uri, Resources resources )
    throws Exception
  {
    URL u = new URL( uri );

    TransportData c = new Tcp2Connection( u, resources );

    TransportPacket p = new Packetizer( c, u, resources );

    TransportMessage m = new Messagizer( p, u, resources );
View Full Code Here


  public DeliveryService newTransport( String uri, Resources resources )
    throws Exception
  {
    URL u = new URL( uri );

    TransportData c = new Tcp2Connection( u, resources );

    TransportPacket p = new Packetizer( c, u, resources );

    TransportMessage m = new Messagizer( p, u, resources );
View Full Code Here

  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void constructor1() throws Exception
  {
    // no host or port
    new Tcp2Connection( "tcp:", r );
  }
View Full Code Here

  {
    SocketChannel s = newSocketChannel( "127.0.0.1", port );
    SocketChannel t = lh.accepted.waitUntilNotEqAndSet( null, TIMEOUT, null );
   
    r.put( "connection", s );
    Tcp2Connection c = new Tcp2Connection( "tcp:", r );
    assertNull( c.getSession() );
   
    s.close();
    t.close();
  }
View Full Code Here

    SessionData dh = new MyDataHandler();
    SocketChannel s = newSocketChannel( "127.0.0.1", port );
    SocketChannel t = lh.accepted.waitUntilNotEqAndSet( null, TIMEOUT, null );

    r.put( "connection", s );
    Tcp2Connection c = new Tcp2Connection( "tcp:", r );
    c.setSession( dh );
    assertSame( dh, c.getSession() );
   
    s.close();
    t.close();
  }
View Full Code Here

  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void constructor5a() throws Exception
  {
    // no port
    new Tcp2Connection( "tcp://localhost", r );
  }
View Full Code Here

  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void constructor5b() throws Exception
  {
    // zero port
    new Tcp2Connection( "tcp://localhost:0", r );
  }
View Full Code Here

  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void constructor6() throws Exception
  {
    // too big port
    new Tcp2Connection( "tcp://localhost:65536", r );
  }
View Full Code Here

  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void constructor7() throws Exception
  {
    // negative reconnect delay
    new Tcp2Connection( "tcp://localhost:1?TcpTransport.reconnectDelay=-1", r );
  }
View Full Code Here

  /** @throws Exception */
  @Test
  public void constructor8() throws Exception
  {
    Tcp2Connection c = new Tcp2Connection( "tcp://localhost:"+port, r );
    assertNull( c.getSession() );
  }
View Full Code Here

TOP

Related Classes of etch.util.core.nio.Tcp2Connection

Copyright © 2018 www.massapicom. 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.