code: public synchronized boolean onPacket(PacketListener listener) {
  		if (listener == null) {
  			return false;
  		}
  		if (listeners == null) {
  			listeners = new PacketListener[] { listener };
  		} else {
  			for (PacketListener test : listeners) {
  				if (test == listener) {
  					return false;
  				}
  			}
  			PacketListener[] copy = new PacketListener[listeners.length];
  			System.arraycopy(listeners, 0, copy, 0, listeners.length);
  			copy[listeners.length] = listener;
  			listeners = copy;
  		}
  		try {
  			if (cause == null) {
  				for (byte[] bytes : buffer) {
  					if (bytes == CLOSE_MARKER) {
  						listener.onPacket(null, null, true);
  					} else {
  						listener.onPacket(bytes, null, false);
  					}
  				}
  			} else {
  				listener.onPacket(null, cause, true);
  			}
  		} catch (MoleculerError moleculerError) {
  			throw moleculerError;
  		} catch (Throwable error) {
  			throw new MoleculerClientError("Unable to send packet to stream listener!", error, nodeID, null);
  		}
  		return true;
  	}
docs: --- SET EVENT LISTENER ---