谷歌Chrome浏览器和流媒体HTTP连接? [英] Google Chrome and Streaming HTTP connections?

查看:279
本文介绍了谷歌Chrome浏览器和流媒体HTTP连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遇到此块时,谷歌Chrome浏览器的行为不一样的其他浏览器:

Google chrome doesn't behave the same as other browsers when encountering this nugget:

<?php
while (true) {
    echo "<script type='text/javascript'>\n";
    echo "alert('hello');\n";
    echo "</script>";
    flush();

    sleep(5);
}
?>

它似乎在等待的连接,做任何事情之前终止。

It seems that it's waiting for the connection to terminate before doing anything.

除了轮询我怎么可以做类似的事情在谷歌浏览器?

Other than polling how can I do a similar thing in Google Chrome?

推荐答案

有些浏览器需要一定数量的字节的渲染信息之前被下载。我记得我最后一次尝试这样做,你在做什么,我最后不得不抛售像300的空间,以确保浏览器会打扰它。

Some browsers require a certain number of bytes to be downloaded before rendering available data. I remember the last time I tried to do what you're doing I ended up having to dump something like 300 spaces to be sure the browser would bother with it.

这篇关于谷歌Chrome浏览器和流媒体HTTP连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆