Package com.firefly.net.support

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


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


          log.debug("main thread {}", Thread.currentThread()
              .toString());
          Assert.assertThat((String) c.send("hello client"), is("hello client"));
          Assert.assertThat((String) c.send("hello multithread test"), is("hello multithread test"));
          Assert.assertThat((String) c.send("getfile"), is("zero copy file transfers"));
          Assert.assertThat((String) c.send("quit"), is("bye!"));
          log.debug("complete session {}", c.getId());
        }
      });

    }
View Full Code Here

      });

    }

    final TcpConnection c = client.connect();
    Assert.assertThat((String) c.send("hello client 2"), is("hello client 2"));
    Assert.assertThat((String) c.send("quit"), is("bye!"));
  }
}
View Full Code Here

    }

    final TcpConnection c = client.connect();
    Assert.assertThat((String) c.send("hello client 2"), is("hello client 2"));
    Assert.assertThat((String) c.send("quit"), is("bye!"));
  }
}
View Full Code Here

    @Override
    public void run() {
      TcpConnection c = tcpConnections[id];
      for (int i = 0; i < LOOP; i++) {
//        String message = "hello world! " + c.getId();
        String ret = (String) c.send(DATA);
        log.debug("rev: {}", ret);
      }
      c.close(false);
      log.debug("session {} complete", c.getId());
View Full Code Here

    @Override
    public void run() {
      TcpConnection c = tcpConnections[id];
      for (int i = 0; i < LOOP; i++) {
//        String message = "hello world! " + c.getId();
        c.send(DATA, new MessageReceiveCallBack() {

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

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

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

        @Override
        public void messageRecieved(Session session, Object obj) {
          log.debug("rev: {}", obj);
          log.debug("session {} complete", session.getSessionId());
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.