public void close(){
  lock.lock();
  try {
    if (writeTarget == null) {
      closePending=true;
      return;
    }
  }
  finally {
    lock.unlock();
  }
  writeTarget.closeConnection();
}

public void close ( ) { lock . lock ( ) ; try { if ( writeTarget == null ) { closePending = true ; return ; } } finally { lock . unlock ( ) ; } writeTarget . closeConnection ( ) ; }
closes the connection to the peer if one exists , or immediately closes the connection as soon as it opens
