php socket_recvfrom多线程

I have a problem of waiting socket_recvfrom to receive something otherwise the script won't continue running

for( $i= 1024 ; $i <= 65535 ; $i++ ) {
$sock[$i] = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($sock[$i], $sourceips['madcoder'],$i);
socket_connect($sock[$i], '115.188.58.144 ', 1195);
$request = 'data';
socket_write($sock[$i], $request);
$from = '';
$port = 0;
$valeur = socket_recvfrom($sock[$i], $buf, 1222, 0, $from, $port);
}

this code basically send a udp request on a different local port each time and see if he got a response The pogramme now is stuck waiting to receive a packet thanks to socket_recvfrom

I want to make it run as fast as i could without risking to lose a response

i could use

socket_set_option($sock[$i], SOL_SOCKET, SO_RCVTIMEO, array('sec' => 1, 'usec' => 0));

but the problem is waiting for over a 1 second is too much and there is a problem with setting a value of under a second

changing the value to

array('sec' => 0, 'usec' => 100)

or

array('sec' => 0.1, 'usec' => 0)

won't work so i was thinking of multi threading ,The only way i know to multi thread is a "for" loop like i did but i really wish if i could try something else more effective

using pthreads, http://php.net/manual/en/book.pthreads.php , something like

<?php
class async_sender extends Thread {
public function __construct($i,$sourceip){
  $this->i=$i;
  $this->sourceip=$sourceip;
}
 public $sourceip;
 public $finished=false;
 public $response='';
 public $socket=NULL;
 public $i=-1;
public function run(){
    $this->socket=socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
    socket_bind($this->socket, $this->sourceip,$this->i);
    socket_connect($this->socket, '115.188.58.144 ', 1195);
    $request = 'data';
    socket_write($this->socket, $request);
    $from = '';
    $port = 0;

    socket_recvfrom($this->socket, $this->response, 1222, 0, $from, $port);
    $this->finished=true;

}
}

$sender_threads=array();
for( $i= 1024 ; $i <= 65535 ; $i++ ) {
$sender_threads[$i]=new async_sender($i,$sourceips['madcoder']);
$sender_threads[$i]->start();
}