loop = LoopFactory::create(); } public function setHost(string $host) { $this->host = $host; return $this; } public function setPort(int $port) { $this->port = $port; return $this; } public function setLoop(LoopInterface $loop) { $this->loop = $loop; return $this; } public function setHostname(string $hostname) { $this->hostname = $hostname; return $this; } public function createServer() { $socket = new Server("{$this->host}:{$this->port}", $this->loop); $connectionManager = new ConnectionManager($this->hostname, $this->port); $app = new Expose($connectionManager); return new IoServer($app, $socket, $this->loop); } }