ajax ashx session 为空,ajax call the .ashx file - timeout and keeping session alive

Hi All

I have the below ajax call that I'm calling every minute

The idea behind this is to keep the client session alive which works fine

My question is when this is running on the client when will an error be captured in the ajax call?  ( I tried to test this by removing the network cable on the client but it wasn't captured by error).  No network so it can't get to the .ashx file and the

timeouts and is captured?

The point behind this is I have some vpn clients connections and sometimes perhaps 1 or 2 have dropped their sessions ( I know this because I cannot see their connections when running a netstat from the webserver).  When this happens I need to refresh their

screen over the vpn connection so get a new session going.

This may or may not be possible I suspect I 3rd witness kind of application will need to be running to monitor these connections?  But perhaps the below might work

thanks

function heartbeat() {

$.ajax({

type: "GET",

url: "",

data: null,

timeout: 10000,

success: function (data) {

beatHeart(30);

},

failure: function () {

heartfail(400);

screenRefresh();

},

});

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值