PHP头条
热点:

PHPPush服务器端代码-PHP源码


push服务器端

function server() {
    for ($i = 0, $timeout = 10; $i < $timeout; $i++) {
        if (connection_status() != 0) {
            exit();
        }
        $where = array();
        $user_id = $user_id = get_user_id();
        session_write_close();
        $where['user_id'] = $user_id;
        $where['time'] = array('elt', time() - 1);
        $model = M("Push");
        $data = $model -> where($where) -> find();
        $where['id'] = $data['id'];
        //dump($model);
        if ($data) {
            sleep(1);
            $model -> where("id=" . $data['id']) -> delete();
            $this -> ajaxReturn($data['data'], $data['info'], $data['status']);
        } else {
            sleep(2);
        }
    }
    $this -> ajaxReturn(null, "no-data", 0);
}

push客户端



    
    
    
    

相关文章

PHP之友评论

今天推荐