PHPDaemon\Network\Connection::connectUnix PHP Method

connectUnix() public method

Establish UNIX socket connection
public connectUnix ( string $path ) : boolean
$path string Path
return boolean Success
    public function connectUnix($path)
    {
        $this->type = 'unix';
        if (!$this->bevConnectEnabled) {
            $fd = socket_create(AF_UNIX, SOCK_STREAM, 0);
            if (!$fd) {
                return false;
            }
            socket_set_nonblock($fd);
            @socket_connect($fd, $path, 0);
            $this->setFd($fd);
            return true;
        }
        $this->bevConnect = true;
        $this->addr = 'unix:' . $path;
        $this->setFd(null);
        return true;
    }