PHPDaemon\Network\Connection::setPeername PHP Method

setPeername() public method

Sets peer name
public setPeername ( string $host, integer $port ) : void
$host string Hostname
$port integer Port
return void
    public function setPeername($host, $port)
    {
        $this->host = $host;
        $this->port = $port;
        $this->addr = '[' . $this->host . ']:' . $this->port;
        if ($this->pool->allowedClients !== null) {
            if (!TCP::netMatch($this->pool->allowedClients, $this->host)) {
                Daemon::log('Connection is not allowed (' . $this->host . ')');
                $this->ready = false;
                $this->finish();
            }
        }
    }