Flash 客户端 c++服务器连接被对等方重置
我们的应用程序涉及 C++ 套接字服务器、与 C++ 服务器通信的 Flash 客户端以及将 crossdomain.xml 提供给 Flash 客户端的 Python 套接字服务器。 C++ 服务器调用 REST 操作并将结果返回 Flash 客户端。所有这些都托管在 Linux 64 位服务器 - Debian 上。
对于我们的一些用户来说,当游戏服务器尝试从套接字读取(在recv()上)时,我们会遇到很多“连接被对等重置”的情况。 Flash 策略服务器也具有来自“对等方重置连接”的类似数量。
我正在寻找想法、资源,这个问题的原因是什么。当然,这不是由于服务器过载 - 用户的情况 - 有时是 3 个用户,有时是 300 个用户。
我们在自己的私服上进行了测试,情况是一样的。
我们怀疑要解决的问题是:
- Flash 客户端与 C++ 服务器以及套接字通信时出现问题。
- 网络问题
- 一些组合 tcp 选项
我们所做的:
- 捕获来自客户端的安全和 IO 错误。在那里我们只是记录它们:(
我们想做什么:
- 将C++服务器的优先级更改为-5或-10 - 我希望这可以提高IO操作。
我知道“Connection Reset by pear”的原因 - 我检查stackOverFlow 和 google 中都有很多相关内容 - 但我找不到解决这个问题的方法。
We have application that involves C++ socket server, Flash client that communicates with C++ server and Python socket server that gives crossdomain.xml to Flash client.
C++ server calls REST operations and return the results the the Flash client. All of this is hosted on Linux 64bit server - Debian.
For some of our users we have a lots of "Connection reset by peer" when Game server tries to read from socket (on recv()).
Flash policy server also have similar amount from "Connection reset by peer".
I'm looking for ideas, resources what is the reason about this problem. For sure this is not from server overload - what of users - sometimes is with 3 users, some times is with 300 users.
We tested on our private servers and the situation is the same.
What we've suspected to fix the problem:
- Flash client problems to communicate with C++ server and over all with sockets.
- Network problems
- Some combination tcp options
What we've done:
- Catch security and IO erros from the client. There we just log them :(
What we've think to do:
- Change priority of the C++ server to -5 or -10 - I hope this can boost IO operations.
I know the reason for "Connection reset by pear" - I check lots of them in stackOverFlow and google for that - but I can't find way to overcome this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“Connection Reset by Peer”与服务器过载无关,它是一条消息,告诉您远程客户端(或您与客户端之间的某些网络设备)主动关闭了网络连接。
这可能是网络故障的迹象(家庭网关认为连接超时,或者您自己的防火墙认为连接空闲并超时),或者更有可能的是,客户端崩溃或用户刚刚离开页面,因此 Flash 客户端关闭。
我认为如果没有实际遇到问题的人的意见,您将无法轻松诊断问题。
"Connection reset by peer" has nothing to do with server overload, it's a message telling you that the remote client (or some network equipment between you and the client) actively closed down the network connection.
It may be a sign of network trouble (home gateways thinking the connection timed out or your own firewall deciding connections are idle and timing out) or, maybe more likely, the client crashing or the user just navigating away from the page so the Flash client closes.
I don't think you'll easily be able to diagnose the problem without input from people actually having trouble.