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