Package com.google.code.hs4j.network.nio

Examples of com.google.code.hs4j.network.nio.TCPController


  }

  @Test
  public void testAutoReconnect() throws Exception {
    TCPController server = new TCPController();
    server.setHandler(new HandlerAdapter());
    server.bind(new InetSocketAddress(7171));

    this.hsClient.shutdown();
    this.hsClient = new HSClientImpl(new InetSocketAddress(7171), 5);

    Thread.sleep(1000);
    assertEquals(5, server.getSessionSet().size());
    server.stop();
    Thread.sleep(5000);
    server = new TCPController();
    server.setHandler(new HandlerAdapter());
    server.bind(new InetSocketAddress(7171));

    Thread.sleep(10000);
    assertEquals(5, server.getSessionSet().size());

  }
View Full Code Here

TOP

Related Classes of com.google.code.hs4j.network.nio.TCPController

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.