潍坊寒亭区:VB编程:关于防火墙发送"CLOSED"没有反应

来源:百度文库 编辑:神马品牌网 时间:2024/05/09 10:10:45
我使用如下代码:(gettcptable,settcpentry已声明)
Dim i As Integer
Dim locp As Long
Dim tcpt As MIB_TCPTABLE
Dim tcpt2 As MIB_TCPTABLE
GetTcpTable tcpt, Len(MIB_TCPTABLE), 0 'get tcptable 状态
For i = 0 To tcpt.dwNumEntries - 1 '循环所有连接
locp = ntohs(tcpt.table(i).dwLocalPort) 'ip转化
If locp = 6112 Then 'dis 6112
GetTcpTable tcpt2, Len(MIB_TCPTABLE), 0
tcpt2.table(i).dwState = 12
SetTcpEntry tcpt2.table(i) 'set 6112 localport connection to close
Exit For
End If
Next

发送状态12可以断开连接,但用其他任何状态如“CLOSE”就毫无反应,怎么回事?