能够 ping 但在运行我的 python 程序几个小时后无法浏览
这是我用Python编写的一个GUI程序,用于检查在我的XP SP3上运行的网站/服务器状态,多线程用于检查不同的站点/服务器。运行几个小时后,程序开始一直出现 urlopen 超时错误,这种情况总是在服务器(不是某个服务器,可能是 A、B 或 C)发出 POST 请求后发生,而且也不是第一个 POST 请求导致问题,通常在运行几个小时后,碰巧在未知时刻发出 POST 请求,从那时起您得到的只是 urlopen 错误超时。
我仍然可以 ping 通,但无法浏览任何网站,程序关闭后一切正常。这绝对是导致这个问题的程序,好吧,我只是不知道如何调试/检查问题是什么,也不知道它是来自操作系统端还是我的程序浪费了太多资源/连接(您仍然能够当使用太多连接时 ping?),有人可以帮助我吗?
It's a GUI program I wrote in python checking website/server status running on my XP SP3, multi threads are used to check different site/server. After several hours running, the program starts to get urlopen error timed out all the time, and this always happens right after a POST request from a server(not a certain one, might be A or B or C), and it's also not the first POST request causing the problem, normally after several hours running and it happens to make a POST request at an unknown moment, all you get from then on is urlopen error timed out.
I'm still able to ping but cannot browse any site, once the program closed everything's fine. It's definitely the program causing this problem, well I just don't know how to debug/check what the problem is, also don't know if it's from OS side or my program wasting too many resources/connections(are you still able to ping when too many connections used?), would anybody please help me out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确定在每次请求后关闭 TCP 会话吗?尝试时不时地检查 netstat 信息,如果您发现活动/已建立会话的数量正在上升,则意味着您的脚本中存在一些问题。
是的,通常即使您没有可用的 TCP 套接字,也可以 ping 通。
Are you sure you are closing TCP sessions after each request? Try to check netstat information from time to time and if you'll see that the number of active/established sessions is rising it means that you have some problems in your script.
Yes, usually you can ping even if you are out of free TCP sockets.