Esempio n. 1
0
  public void start() {
    if (receiver != null) receiver.stop();
    receiver = new Receiver(server.factory).start();

    if (isSenderUsed()) {
      if (sender != null) sender.stop();
      sender = new Sender(server.factory, server.sendQueueSize()).start();
    }
  }
Esempio n. 2
0
 public void close() throws IOException {
   send_lock.lock();
   try {
     Util.close(out, in, sock);
     if (receiver != null) {
       receiver.stop();
       receiver = null;
     }
     if (sender != null) {
       sender.stop();
       sender = null;
     }
   } finally {
     send_lock.unlock();
   }
 }