Fix Communication Manager
This commit is contained in:
parent
a4594122dc
commit
b88bddb76b
@ -296,9 +296,9 @@ class CommunicationManager implements CallbackListener, UsageInformationAble {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
//TODO check if port is closed
|
//TODO check if port is closed
|
||||||
$this->socket->listen($socketPort, $this->maniaControl->getServer()->ip);
|
$this->socket->listen($socketPort, $socketHost);
|
||||||
|
|
||||||
Logger::log("[CommunicationManager] Socket " . $this->maniaControl->getServer()->ip . ":" . $this->socket->getPort() . " Successfully created!");
|
Logger::log("[CommunicationManager] Socket " . $this->socket->getHost() . ":" . $this->socket->getPort() . " Successfully created!");
|
||||||
} catch (ConnectionException $e) {
|
} catch (ConnectionException $e) {
|
||||||
Logger::log("[CommunicationManager] Exception: " . $e->getMessage());
|
Logger::log("[CommunicationManager] Exception: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,13 @@ class Server extends EventEmitter implements ServerInterface
|
|||||||
$this->emit('connection', array($client));
|
$this->emit('connection', array($client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getHost()
|
||||||
|
{
|
||||||
|
$name = stream_socket_get_name($this->master, false);
|
||||||
|
|
||||||
|
return (int) substr(strrchr($name, ':'), 0);
|
||||||
|
}
|
||||||
|
|
||||||
public function getPort()
|
public function getPort()
|
||||||
{
|
{
|
||||||
$name = stream_socket_get_name($this->master, false);
|
$name = stream_socket_get_name($this->master, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user