Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome AngularJS和Chrome的Bug,取消后挂起的套接字?_Google Chrome_Angularjs - Fatal编程技术网

Google chrome AngularJS和Chrome的Bug,取消后挂起的套接字?

Google chrome AngularJS和Chrome的Bug,取消后挂起的套接字?,google-chrome,angularjs,Google Chrome,Angularjs,有人在AngularJS(1.0.7版)和Chrome(30.0.1599.114版)中看到过这个bug吗?在Chrome中,取消http GET请求会使套接字处于挂起状态,从而使线程池最大化 代码: 您应该将AngularJS更新为1.1.5,以便能够取消http调用。 参考: 下面是工作代码和JS提琴。我已经用AngularJS 1.2.0和Chrome 32.0.1700.0 canary进行了测试 function Ctrl($rootScope, $scope, $http, $q,

有人在AngularJS(1.0.7版)和Chrome(30.0.1599.114版)中看到过这个bug吗?在Chrome中,取消http GET请求会使套接字处于挂起状态,从而使线程池最大化

代码:


您应该将AngularJS更新为1.1.5,以便能够取消http调用。 参考:

下面是工作代码和JS提琴。我已经用AngularJS 1.2.0和Chrome 32.0.1700.0 canary进行了测试

function Ctrl($rootScope, $scope, $http, $q, $timeout) {
    var canceler = $q.defer();

    console.log("Calling...");
    $http.get("/echo/json", {
        //Will return data after 5 seconds passed
        data: {json: {id: "123"}, delay: 5},
        timeout: canceler.promise
    }).success(function (results) {
            console.log("Success");
            console.log(results);
        }).
        error(function (result) {
            console.log("Error");
            console.log(result);
        });

    $timeout(function () {
        console.log("1 second passed");
        // now, cancel it (before it may come back with data)
        $rootScope.$apply(function () {
            console.log("Canceling..");
            canceler.resolve();
        });
    }, 1000);
}

请求已变为取消状态


您应该将AngularJS更新为1.1.5,以便能够取消http调用。 参考:

下面是工作代码和JS提琴。我已经用AngularJS 1.2.0和Chrome 32.0.1700.0 canary进行了测试

function Ctrl($rootScope, $scope, $http, $q, $timeout) {
    var canceler = $q.defer();

    console.log("Calling...");
    $http.get("/echo/json", {
        //Will return data after 5 seconds passed
        data: {json: {id: "123"}, delay: 5},
        timeout: canceler.promise
    }).success(function (results) {
            console.log("Success");
            console.log(results);
        }).
        error(function (result) {
            console.log("Error");
            console.log(result);
        });

    $timeout(function () {
        console.log("1 second passed");
        // now, cancel it (before it may come back with data)
        $rootScope.$apply(function () {
            console.log("Canceling..");
            canceler.resolve();
        });
    }, 1000);
}

请求已变为取消状态


您应该将AngularJS更新为1.1.5,以便能够取消http调用。 参考:

下面是工作代码和JS提琴。我已经用AngularJS 1.2.0和Chrome 32.0.1700.0 canary进行了测试

function Ctrl($rootScope, $scope, $http, $q, $timeout) {
    var canceler = $q.defer();

    console.log("Calling...");
    $http.get("/echo/json", {
        //Will return data after 5 seconds passed
        data: {json: {id: "123"}, delay: 5},
        timeout: canceler.promise
    }).success(function (results) {
            console.log("Success");
            console.log(results);
        }).
        error(function (result) {
            console.log("Error");
            console.log(result);
        });

    $timeout(function () {
        console.log("1 second passed");
        // now, cancel it (before it may come back with data)
        $rootScope.$apply(function () {
            console.log("Canceling..");
            canceler.resolve();
        });
    }, 1000);
}

请求已变为取消状态


您应该将AngularJS更新为1.1.5,以便能够取消http调用。 参考:

下面是工作代码和JS提琴。我已经用AngularJS 1.2.0和Chrome 32.0.1700.0 canary进行了测试

function Ctrl($rootScope, $scope, $http, $q, $timeout) {
    var canceler = $q.defer();

    console.log("Calling...");
    $http.get("/echo/json", {
        //Will return data after 5 seconds passed
        data: {json: {id: "123"}, delay: 5},
        timeout: canceler.promise
    }).success(function (results) {
            console.log("Success");
            console.log(results);
        }).
        error(function (result) {
            console.log("Error");
            console.log(result);
        });

    $timeout(function () {
        console.log("1 second passed");
        // now, cancel it (before it may come back with data)
        $rootScope.$apply(function () {
            console.log("Canceling..");
            canceler.resolve();
        });
    }, 1000);
}

请求已变为取消状态


您是否尝试过使用chrome的金丝雀版本查看是否修复?您是否尝试过使用chrome的金丝雀版本查看是否修复?您是否尝试过使用chrome的金丝雀版本查看是否修复?您是否尝试过使用chrome的金丝雀版本查看是否修复?