code: public synchronized boolean sendClose() {
  		if (closed.compareAndSet(false, true)) {
  			try {
  				if (listeners == null) {
  					buffer.addLast(CLOSE_MARKER);
  				} else if (listeners.length == 1) {
  					listeners[0].onPacket(null, cause, true);
  				} else {
  					for (PacketListener listener : listeners) {
  						listener.onPacket(null, cause, true);
  					}
  				}
  			} catch (Throwable error) {
  				logger.warn("Unable to send close marker to stream listener!", error);
  				return false;
  			}
  			return true;
  		}
  		return false;
  	}
docs: --- SEND CLOSE MARKER ---