Only consider NR mode if the offset presented is -1
This commit is contained in:
@@ -249,14 +249,13 @@ abstract class Protocol
|
||||
*/
|
||||
public function onConnect(SocketClient $client): ?int
|
||||
{
|
||||
$ppid = getmypid();
|
||||
$pid = pcntl_fork();
|
||||
|
||||
if ($pid === -1)
|
||||
throw new SocketException(SocketException::CANT_ACCEPT,'Could not fork process');
|
||||
|
||||
if ($pid)
|
||||
Log::info(sprintf('%s:- Running connection in pid [%d] (%d)',self::LOGKEY,$pid,$ppid));
|
||||
Log::info(sprintf('%s:+ New connection, thread [%d] created',self::LOGKEY,$pid));
|
||||
|
||||
// Parent return ready for next connection
|
||||
return $pid;
|
||||
|
Reference in New Issue
Block a user