Example #1
0
 public void onData(TCPClientLoop l, SocketChannel sc, ByteBuffer buf) {
   l.write(sc, this, buf);
   ++count;
   if (Speed.NUM == count) {
     p("here");
     l.shutdownOutput(sc, this);
     l.close(sc, this);
     l.st("");
     l.stopLoop();
   }
 }
Example #2
0
 public void onClose(TCPClientLoop l, SocketChannel sc) {
   l.stopLoop();
   p((System.currentTimeMillis() - time));
 }
Example #3
0
 public void onConnect(TCPClientLoop l, SocketChannel sc) {
   l.write(sc, this, "hello".getBytes());
 }
Example #4
0
  static void client() {
    TCPClientLoop loop = new TCPClientLoop();
    loop.start();

    loop.createTCPClient(new Client(), "localhost", 4321);
  }