$input = socket_read($clients[$i]['socket'],2048);
$lent = strlen($input);
echo "\n\n$lent\n";
echo "\nDATA: ".$input."\n";
My actual data length to read is >512.
Can somebody help me?
$input = socket_read($clients[$i]['socket'],2048);
$lent = strlen($input);
echo "\n\n$lent\n";
echo "\nDATA: ".$input."\n";
My actual data length to read is >512.
Can somebody help me?
Please take a look at this thread:
Can't read from socket (hangs)
while($resp = socket_read($clients[$i]['socket'], 1000)) {
$str .= $resp;
if (strpos($str, "\n") !== false) break;
}
socket_close($sock);
die("Server said: $str");
This set of code loops until the response is empty.