Package test.net.tcp.example

Examples of test.net.tcp.example.PipelineClientHandler


  }

  public static void main(String[] args) {
    ExecutorService executorService = Executors.newFixedThreadPool(THREAD);
    final SimpleTcpClient client = new SimpleTcpClient("localhost", 9900,
        new StringLineDecoder(), new StringLineEncoder(), new PipelineClientHandler());
    final CyclicBarrier barrier = new CyclicBarrier(THREAD, new StatTask());

    for (int i = 0; i < THREAD; i++)
      executorService.submit(new ClientSynchronizeTask(client, barrier));
View Full Code Here


import com.firefly.net.support.wrap.client.TcpConnection;
import com.firefly.utils.log.LogFactory;

public class SimpleTcpClientExample {
  public static void main(String[] args) throws Throwable {
    final SimpleTcpClient client = new SimpleTcpClient("localhost", 9900, new StringLineDecoder(), new StringLineEncoder(), new PipelineClientHandler());
    long start = System.currentTimeMillis();
    TcpConnection c = client.connect().get();
    long end = System.currentTimeMillis();
    System.out.println("connection 0 creating time is " + (end - start));
    System.out.println("current conn id: " + c.getId());
View Full Code Here

    server.setConfig(config);
    server.start("localhost", 9900);

    final int LOOP = 50;
    ExecutorService executorService = Executors.newFixedThreadPool(LOOP);
    final SimpleTcpClient client = new SimpleTcpClient("localhost", 9900, new StringLineDecoder(), new StringLineEncoder(), new PipelineClientHandler());

    for (int i = 0; i < LOOP; i++) {
      executorService.submit(new Runnable() {
        @Override
        public void run() {
View Full Code Here

TOP

Related Classes of test.net.tcp.example.PipelineClientHandler

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.