/** * @param \Ratchet\MessageComponentInterface $component Your application to run with WebSockets * If you want to enable sub-protocols have your component implement WsServerInterface as well */ public function __construct(MessageComponentInterface $component) { $this->versioner = new VersionManager(); $this->validator = new ToggleableValidator(); $this->versioner->enableVersion(new Version\RFC6455($this->validator))->enableVersion(new Version\HyBi10($this->validator))->enableVersion(new Version\Hixie76()); $this->component = $component; $this->connections = new \SplObjectStorage(); }
/** * @param Ratchet\MessageComponentInterface Your application to run with WebSockets */ public function __construct(MessageComponentInterface $component) { //mb_internal_encoding('UTF-8'); $this->reqParser = new HttpRequestParser(); $this->versioner = new VersionManager(); $this->versioner->enableVersion(new Version\RFC6455($component))->enableVersion(new Version\HyBi10($component))->enableVersion(new Version\Hixie76()); $this->_decorating = $component; $this->connections = new \SplObjectStorage(); }
/** * Initialize the web socket server with the container's applications. * * @param array $applications The initialized applications */ public function __construct(&$applications) { // initialize the web socket server instance $this->reqParser = new HttpRequestParser(); $this->versioner = new VersionManager(); $this->validator = new ToggleableValidator(); // enable the allowed web socket versions $this->versioner->enableVersion(new Version\RFC6455($this->validator))->enableVersion(new Version\HyBi10($this->validator))->enableVersion(new Version\Hixie76()); // initialize connection pool and applications $this->connections = new \SplObjectStorage(); $this->applications =& $applications; }