File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -616,14 +616,16 @@ protected static function parseCommand()
616
616
self ::log ("Workerman[ $ start_file] already running " );
617
617
exit ;
618
618
}
619
- } elseif ($ command !== 'start ' && $ command !== 'restart ' ) {
619
+ } elseif ($ command !== 'start ' && $ command !== 'restart ' && $ command !== ' kill ' ) {
620
620
self ::log ("Workerman[ $ start_file] not run " );
621
+ exit ;
621
622
}
622
623
623
- // Execure command.
624
+ // execute command.
624
625
switch ($ command ) {
625
626
case 'kill ' :
626
627
exec ("ps aux | grep $ start_file | grep -v grep | awk '{print $2}' |xargs kill -SIGINT " );
628
+ usleep (100000 );
627
629
exec ("ps aux | grep $ start_file | grep -v grep | awk '{print $2}' |xargs kill -SIGKILL " );
628
630
break ;
629
631
case 'start ' :
@@ -1505,7 +1507,7 @@ public function acceptConnection($socket)
1505
1507
// Accept a connection on server socket.
1506
1508
$ new_socket = @stream_socket_accept ($ socket , 0 , $ remote_address );
1507
1509
// Thundering herd.
1508
- if (false === $ new_socket ) {
1510
+ if (! $ new_socket ) {
1509
1511
return ;
1510
1512
}
1511
1513
Original file line number Diff line number Diff line change 31
31
list ($ method , $ addr , $ http_version ) = explode (' ' , $ buffer );
32
32
$ url_data = parse_url ($ addr );
33
33
$ addr = !isset ($ url_data ['port ' ]) ? "{$ url_data ['host ' ]}:80 " : "{$ url_data ['host ' ]}: {$ url_data ['port ' ]}" ;
34
+ // Async TCP connection.
34
35
$ remote_connection = new AsyncTcpConnection ("tcp:// $ addr " );
35
36
// CONNECT.
36
37
if ($ method !== 'CONNECT ' ) {
You can’t perform that action at this time.
0 commit comments