| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 542 人关注过本帖
标题:谁帮我看看这个 winsock 为什么无法连接
取消只看楼主 加入收藏
zhuiis
Rank: 4
等 级:业余侠客
威 望:1
帖 子:201
专家分:286
注 册:2008-11-8
结帖率:82.14%
收藏
已结贴  问题点数:20 回复次数:0 
谁帮我看看这个 winsock 为什么无法连接
这个连接总是出现“40020错误,当前状态的操作无效”
Winsock.zip (2.65 KB)

请大家帮我看看,这到底是怎么回事!谢谢了!

Private Sub Command1_Click()
Command1.Enabled = False
Winsock2.RemoteHost = "192.168.1.101"
Winsock2.RemotePort = 1001
Winsock2.Connect "192.168.1.101"
End Sub

Private Sub Command2_Click()
Winsock2.SendData Text2.Text
End Sub

Private Sub Form_Load()
Winsock1.LocalPort = 1001
Winsock1.Listen
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Accept requestID
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim TmpStr As String
Winsock1.GetData TmpStr
Text1.Text = TmpStr
End Sub

Private Sub Winsock2_Connect()
Command2.Enabled = True
End Sub

Private Sub Winsock2_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Command1.Enabled = True
Command2.Enabled = False
End Sub
2011-05-24 22:38
快速回复:谁帮我看看这个 winsock 为什么无法连接
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.094991 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved