You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//create an Internet or Unix domain server socket
$this->_mainSocket = stream_socket_server($local_socket, $errno, $errmsg, $flags, $this->_context);
if(!$this->_mainSocket) throw new \Exception($errmsg);
代码如下:
`
list($scheme, $address) = explode(':', $this->_socketName, 2);
//only support tcp & udp currently
if(!in_array(strtolower($scheme), array('tcp', 'udp')))
{
self::showHelpByeBye('only support TCP & UDP protocol currently ...'); // 1. unixsocket 直接exit(0);
}
$this->transport = $scheme;
$local_socket = self::$_builtinTransports[$this->transport] . ":" . $address;
//flag
$flags = $this->transport === 'udp' ? STREAM_SERVER_BIND : STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
$errno = 0;
$errmsg = '';
//create an Internet or Unix domain server socket
$this->_mainSocket = stream_socket_server($local_socket, $errno, $errmsg, $flags, $this->_context);
if(!$this->_mainSocket) throw new \Exception($errmsg);
if($this->transport === 'ssl')
{
stream_socket_enable_crypto($this->_mainSocket, false);
}
elseif($this->transport === 'unix') // 2. 既然都不支持unixsocket 为何还要存在这段代码?
{ // 3.. 这样不是多余了?
$socket_file = substr($address, 2);
$this->user && chown($socket_file, $this->user);
$this->group && chgrp($socket_file, $this->group);
}
`
The text was updated successfully, but these errors were encountered: