$per_len = 20000; //每次读多少字节
$no_read_len = $content_len; //未读的字节(总字节大小)
$str = ‘‘;
while($len<$content_len)
{
$read = socket_read($socket, $per_len,PHP_BINARY_READ);
$str .= $read;
$len += strlen($read); //总共读了多少字节
}
http://hi.baidu.com/cuttinger/item/1c4444266f2b463395f62bfa