Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$input = socket_read($clients[$i]['socket'],2048); $lent = strlen($input); echo "\n\n$lent\n"; echo "\nDATA: ".$input."\n";
我要读取的实际数据长度> 512。
有人可以帮助我吗?
请看一下这个线程:
无法从套接字读取(挂起)
while($resp = socket_read($clients[$i]['socket'], 1000)) { $str .= $resp; if (strpos($str, "\n") !== false) break; } socket_close($sock); die("Server said: $str");
这组代码循环,直到响应为空。