docs: @Override
  	public void close() throws Exception {
  		// flag this as not running any more
  		isRunning = false;
  
  		// clean up in locked scope, so there is no concurrent change to the stream and client
  		synchronized (lock) {
  			// we notify first (this statement cannot fail). The notified thread will not continue
  			// anyways before it can re-acquire the lock
  			lock.notifyAll();
  
  			try {
  				if (outputStream != null) {
  					outputStream.close();
  				}
  			}
  			finally {
  				if (client != null) {
  					client.close();
  				}
  			}
  		}
  	}