if(isset($_GET['actionid']) && isset($_GET['profileid']))
{
$actionid = $_GET['actionid'];
$profileid = $_GET['profileid'];
$res = $database->news_poll($profileid,$actionid);
$k = 0;
while(!$NROW =$res->fetch_array())
{
usleep('50000000');
$res = $database->news_poll($profileid,$actionid);
}
$action = actiontype_encode($NROW,'0',$json,$encode,$database);
$data['action'] = $action;
echo json_encode($data);
}
这是我的脚本轮询服务器的新数据。 但工作浏览器停止工作只为我的网站。我想问题是,当一个特定的浏览器订阅新数据时,连接保持打开状态,因此浏览器不会再向同一台服务器发出请求。请解释是否有问题。不能实现长轮询
我需要实施长时间轮询。这是非常重要的,真的需要使用长轮询而不是短轮询来实现它。请帮助。请指出实施中的实际问题。 – 2012-03-15 14:14:04