function __construct(ReactSocketServer $socket, MiddlewareAdapter $hub) { parent::__construct($socket); $this->hub = $hub; $this->on('request', array($this, 'onRequest')); }