javascript - 错误:远程主机强制关闭现有连接
问题描述
无法访问服务并出现以下错误:
现有连接被远程主机强行关闭。
我正在使用一些数据访问 POST-OData 服务。当我在1分钟内输入数据时,服务成功并发布数据。但是当我在一分钟内输入数据时,我收到了这个错误。正在使用 SQL 服务器。在这种情况下,服务不会受到影响。
$.ajax({
url: "/Non_SAP_Instrumentation/odata/LoopDrawing",
method: "POST",
data: {
"UnitNumber": unit_no,
"TagName": tag_name,
"SysTagName": sys_tag_name,
"TagDesc": tag_description,
"JbNo": jb_no,
"JbPairNo": jb_pair_no,
"JbTerminal": jb_terminal,
"IoType": io_type,
"Ctrl": controller,
"Node": node,
"Slot": slot,
"Channel": channel,
"Segment": segment,
"Redundancy": redundancy,
"MarCab": marsh_cab,
"SurgeProtc": surge_protc,
"Barrier": barrier,
"Relay": relay,
"FuseTbGrp": fuse_tb_group,
"FuseTbTerm": fuse_tb_term,
"Update": "No",
"CreatedBy": that.name,
"CreatedByID": that.EmpModel.getProperty("/").name,
"ModifiedBy": that.name,
"ModifiedByID": that.EmpModel.getProperty("/").name
},
dataType: "json",
success: function(data) {
var value = JSON.parse(data.value);
sap.ui.core.BusyIndicator.hide();
if (value.Status == "OK") {
MessageBox.information("Loop Drawing has been created", {
onClose: function() {
that.router.navTo("TagMasterPage", {
TAG: tag_name
});
that.makingFieldsBlank();
that.window.location.reload();
}
});
} else {
sap.ui.core.BusyIndicator.hide();
MessageBox.information("Unable to create Loop Drawing", {
onClose: function() {
that.router.navTo("SearchOrCreate");
that.window.location.reload();
}
});
}
},
error: function(err) {
sap.ui.core.BusyIndicator.hide();
console.log(err.responseText);
MessageBox.information("Unable to create Loop Drawing", {
onClose: function() {
that.router.navTo("SearchOrCreate");
}
});
}
解决方案
这可以通过以下步骤来实现:1) 转到 IIS 2) 转到 Web 应用程序的高级设置 3) 选择连接限制并设置连接超时。
但它会降低服务器的性能。所以连接超时限制应该相应地设置为最小值。
推荐阅读
- php - 如何使用 preg_replace 从这个字符串中删除最后一个特殊字符?
- javascript - 如何使用用户名从我的数据库中为某个用户调用和回显一个值来识别用户
- angular9 - 角度调查动态问题渲染模板驱动或反应
- java - 布尔默认值 MapStruct
- amazon-web-services - 推荐用于 Adobe ColdFusion 生产环境的 Docker 映像是什么?
- c - C printf 可选小数位
- javascript - 重构 Express 代码并且无法确定变量范围
- python - 不同python版本的子流程执行
- java - 使用 Optional.map() 而不是 Optional.ifPresent() 来执行可能引发异常的代码并返回任何异常作为返回值
- javascript - 有没有办法让一个元素旋转而没有一个变量告诉它已经转动了多远?