- 论坛徽章:
- 0
|
本帖最后由 ificanfly 于 2014-08-29 09:53 编辑
- $host = "127.0.0.1";
- $port = 1987;
- //$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)or die("Could not create socket\n"); // 创建一个Socket
- $socket = fsockopen("127.0.0.1", 1987, $errno, $errstr, 30);
- if(!$socket)
- {
- echo "$errstr ($errno)<br />\n";
- }else{
- fwrite($socket, $this->msg);
- fflush($socket);
- $buff = "aa";
- $data = "aa";
- while(!feof($socket)){
- $buff = fgets($socket,8192);
- $data = $data. $buff;
- }
- fsockclose($socket);
- return $data;
- }
复制代码 service https stop后缓冲区才能被处理。
代码有问题 or php.ini 或者httpd.conf的问题?
请指导下,谢谢 |
|