Código:
Cómo puedo establecer un tiempo de caducidad para "socket_read" ? while (true){
$client = socket_accept($sock);
//Aquí se detiene la ejecución ya que se queda esperando al contenido del
//paquete deja abierta la conexión con el cliente permanentemente
$input = socket_read($client, 1024) or die("Cannot read from socket");
save_data($input);
socket_write($client, $input);
socket_close($client);
}
PD: He probado con el siguiente código, pero me da fallo...
Código:
$timeout = array('sec'=>1,'usec'=>500000);
socket_set_option($client,SOL_SOCKET,SO_RCVTIMEO,$timeout);



