Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function _gs($s){echo "GOT SIG #$s\n";};
- pcntl_signal(SIGUSR1, '_gs');
- var_dump(getmypid());
- $s = stream_socket_server('tcp://0.0.0.0:9999');
- $rBase = [$s, fopen('php://stdin', 'r')];
- foreach($rBase as $set){
- stream_set_blocking($set, 0);
- }
- while(true) {
- $r = $rBase;
- $w = [];
- $e = $rBase;
- $ss = stream_select($r, $w, $e, null);
- var_dump($ss, $r, $w, $e);
- echo "\n-------------------------------------\n";
- sleep(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement