This commit is contained in:
Marcel Pociot committed 2020-04-14 21:43:06 +02:00
1 parent f54c13aec4
commit 87d254db63
3 files changed
+17 -6

No files matched your search

+11 -1
View File
@@ -12,6 +12,9 @@ class Factory
/** @var string */
protected $host = '127.0.0.1';
/** @var string */
protected $hostname = 'localhost';
/** @var int */
protected $port = 8080;
@@ -44,11 +47,18 @@ class Factory
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->host, $this->port);
$connectionManager = new ConnectionManager($this->hostname, $this->port);
$app = new Shaft($connectionManager);