Package com.firefly.net.support.wrap.client

Examples of com.firefly.net.support.wrap.client.TcpConnection.send()


          }
          Assert.assertThat(c.isOpen(), is(true));
          log.debug("main thread {}", Thread.currentThread()
              .toString());
          try {
            Assert.assertThat((String) c.send("hello client").get(), is("hello client"));
            Assert.assertThat((String) c.send("hello multithread test").get(), is("hello multithread test"));
            Assert.assertThat((String) c.send("getfile").get(), is("zero copy file transfers"));
            Assert.assertThat((String) c.send("quit").get(), is("bye!"));
          } catch (InterruptedException e) {
            e.printStackTrace();
View Full Code Here


          Assert.assertThat(c.isOpen(), is(true));
          log.debug("main thread {}", Thread.currentThread()
              .toString());
          try {
            Assert.assertThat((String) c.send("hello client").get(), is("hello client"));
            Assert.assertThat((String) c.send("hello multithread test").get(), is("hello multithread test"));
            Assert.assertThat((String) c.send("getfile").get(), is("zero copy file transfers"));
            Assert.assertThat((String) c.send("quit").get(), is("bye!"));
          } catch (InterruptedException e) {
            e.printStackTrace();
          } catch (ExecutionException e) {
View Full Code Here

          log.debug("main thread {}", Thread.currentThread()
              .toString());
          try {
            Assert.assertThat((String) c.send("hello client").get(), is("hello client"));
            Assert.assertThat((String) c.send("hello multithread test").get(), is("hello multithread test"));
            Assert.assertThat((String) c.send("getfile").get(), is("zero copy file transfers"));
            Assert.assertThat((String) c.send("quit").get(), is("bye!"));
          } catch (InterruptedException e) {
            e.printStackTrace();
          } catch (ExecutionException e) {
            e.printStackTrace();
View Full Code Here

              .toString());
          try {
            Assert.assertThat((String) c.send("hello client").get(), is("hello client"));
            Assert.assertThat((String) c.send("hello multithread test").get(), is("hello multithread test"));
            Assert.assertThat((String) c.send("getfile").get(), is("zero copy file transfers"));
            Assert.assertThat((String) c.send("quit").get(), is("bye!"));
          } catch (InterruptedException e) {
            e.printStackTrace();
          } catch (ExecutionException e) {
            e.printStackTrace();
          }
View Full Code Here

    }

    TcpConnection c = client.connect().get();
    try {
      Assert.assertThat((String) c.send("hello client 2").get(), is("hello client 2"));
      Assert.assertThat((String) c.send("quit").get(), is("bye!"));
    } finally {
      c.close(false);
    }
   
View Full Code Here

    }

    TcpConnection c = client.connect().get();
    try {
      Assert.assertThat((String) c.send("hello client 2").get(), is("hello client 2"));
      Assert.assertThat((String) c.send("quit").get(), is("bye!"));
    } finally {
      c.close(false);
    }
   
  }
View Full Code Here

        e1.printStackTrace();
      }
      try {
        for (int i = 0; i < LOOP; i++) {
          String message = "hello world! " + c.getId();
          String ret = (String) c.send(message).get();
          log.debug("rev: {}", ret);
        }
      } catch (InterruptedException e) {
        e.printStackTrace();
      } catch (ExecutionException e) {
View Full Code Here

      } catch (ExecutionException e1) {
        e1.printStackTrace();
      }
      for (int i = 0; i < LOOP; i++) {
        String message = "hello world! " + c.getId();
        c.send(message, new MessageReceivedCallback() {

          @Override
          public void messageRecieved(TcpConnection connection, Object obj) {
            log.debug("rev: {}", obj);
          }
View Full Code Here

            log.debug("rev: {}", obj);
          }
        });

      }
      c.send("quit", new MessageReceivedCallback() {

        @Override
        public void messageRecieved(TcpConnection connection, Object obj) {
          log.debug("rev: {}", obj);
          log.debug("session {} complete", connection.getId());
View Full Code Here

    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());
    c.send("hello client 1", new MessageReceivedCallback() {

      @Override
      public void messageRecieved(TcpConnection connection, Object obj) {
        System.out.println("con1|" + obj.toString());
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.