我现在是客户端在循环从服务端读数据,如何检测到服务端断开,自动关闭该socket
解决方案 »
- at指令,写入sim卡卡号,获取sim卡号。
- RichEdit:如何使某指定的几个部分只读,而其他部分可改写?
- 菜鸟请教高手有关在VC++中使用DLL的问题!!!
- ADO中 .和->运算符
- 后台运行的程序怎样获得当前窗口的消息?
- vc向导中可以做三种DLL,请问这三种滴溜溜DLL有什么不同
- ADO记录集GetRecordCount()返回记录条数为啥总为-1??
- 不明白这个例子是怎么做的
- txt文件转换成SQL数据库
- 请问怎么向EDIT框加字符串
- 请提供一个写成EXE的COM组件,简单一点。我只是想看看怎么导处接口的。马上揭帖
- 【^_^】自己花了一星期的时间写了个同学录软件.献给大家希望大家喜欢,谢谢.(内详)
若非正常关闭,只能靠其它方式,比如发送不成功,根据返回的状态值判断
GetTcpTable
The GetTcpTable function retrieves the TCP connection table.DWORD GetTcpTable (
PMIB_TCPTABLE pTcpTable // buffer for the connection table
PDWORD pdwSize // size of the buffer
BOOL bOrder // sort the table?);
Parameters
pTcpTable
Pointer to a buffer that, on successful return, contains the TCP connection table as a MIB_TCPTABLE structure.
pdwSize
Specifies the size of the buffer pointed to by the pTcpTable parameter. If the buffer is not large enough to hold the returned connection table, the function sets this parameter equal to the required buffer size.
bOrder
Specifies whether the connection table should be sorted. If this parameter is TRUE, the table is sorted in order of:
Local IP address Local port Remote IP address Remote port Return Values
If the function succeeds, the return value is NO_ERROR.If the function fails, use FormatMessage to obtain the message string for the returned error.