检查服务器是否繁忙 [英] Checking to see server is busy

查看:76
本文介绍了检查服务器是否繁忙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我有以下代码,每秒钟将一些值写入表到共享主机上的远程服务器.在共享主机上有很多时间,它会产生SEVER BUSY错误,我正在寻找一些检查或循环,以检查Server是否在5秒内正忙于重试它并继续执行直到再次开始写入.... any想法怎么做???谢谢

Hello everybody
I have following code to write some values to a table every one second to a remote server on shared hosting. Being on shared hosting alot of time it gives SEVER BUSY error, i was looking for a some check or loop that would check if Server was busy to re try it in 5 seconds and keep doing it until it starts writing again....any idea how to do it??? thanks

cmd = new SqlCommand("insert into DC values('" + Rate.Text + "')", con);
cmd.ExecuteNonQuery();

推荐答案

代替编写轮询逻辑,您可以尝试使用CallBack方法.
In stead of writing polling logic, you can try using CallBack method.


这篇关于检查服务器是否繁忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆