Windows套接字诊断 [英] Windows socket diagnosic

查看:116
本文介绍了Windows套接字诊断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在套接字编程中,我如何语法(C ++)识别
通常,套接字诊断选项有哪些?
我正在使用XP/Server 2003和Visual Studio2005.

谢谢您
Matoust

In socket programming, how I can grammatically (C++) identify  that the Ethernet cable is unplugged?
Generally, what are socket diagnostic options?
I am using XP / Server 2003 and Visual Studio 2005.

Thank you
Matoust

推荐答案

网络已断开仅当应用程序尝试从套接字读取数据/将数据写入套接字时,错误才会传播到套接字状态.
1.如果断开连接时客户端与服务器之间已建立的连接可用,则该连接将很容易传播,因为我们将在两端进行读/写操作.

2.如果未建立任何连接,则套接字状态将不会更改,直到我们尝试进行某些连接操作
请让我们知道您的问题情况以及您已解决了多大程度?
Network disconnected error is propagated to socket state only when the application try to read data from / write data to socket.
1. If an established connection is available between client and server at the time of disconnection then it will propagate easily as we will be doing a read / write operation at both ends.

2. If no connection is established then the socket state will not change until we attempt some connect operation
Please let us know about your problem situation now and how far you have solved it?


这篇关于Windows套接字诊断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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