C++发送返回 SOCKET_ERROR
在我的 C++ 应用程序中,我使用网络连接 (TCP)。 当我发现网络连接错误时,我尝试连接到另一个接口。 在重新连接中,连接函数已顺利通过,但在发送函数上,它返回 SOCKET_ERROR 且 WSGetLastError 返回 10054。 你知道这个错误的含义是什么以及我应该做什么来解决它?
10倍
In my C++ application I'm using network connection (TCP).
when I'm identify a network connection error I'm trying to connect to another interface.
in the reconnection the connect function has passed with no error but on send function it return an SOCKET_ERROR and WSGetLastError return 10054.
do you know what is the meaning of this error and what should I do to resolve it?
10x
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
10054
表示 连接被对等方重置 - 远程端点回复一个RST
数据包,告诉您连接未打开。使用connect()
重新连接,而不是尝试简单地更改本地端的接口。10054
means connection reset by peer -- the remote endpoint replied with anRST
packet to tell you that the connection isn't open. Reconnect withconnect()
instead of trying to simply change interfaces on your local end.10054(连接由对等方重置)成功 connect() 意味着服务器接受传入连接,但之后它关闭接受的套接字而不等待传入信息。解决此问题的唯一方法是检查服务器应用程序逻辑。
10054 (connection reset by peer) after successfull connect() means that the server accepts incoming connection but after that it closes the accepted socket without waiting for incoming information. The only way to resolve this is to check the server application logic.