Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (28 sloc) 519 Bytes
<?php
$clients = array();
for($j = 0; $j < 2; $j++)
{
$pid = pcntl_fork();
if($pid > 0)
{
continue;
}
else
{
for($i = 0; $i < 9999; $i++){
$client = new swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_SYNC); //同ζ­₯阻呞
$ret = $client->connect('127.0.0.1', 9501, 0.5);
if(!$ret)
{
echo "#$i\tConnect fail. errno=".$client->errCode;
die("\n");
}
$clients[] = $client;
usleep(10);
}
echo "Worker #".posix_getpid()." connect $i finish\n";
sleep(1000);
exit;
}
}
sleep(1000);
You can’t perform that action at this time.