| 发表于:2007-11-01 22:16:27 楼主 |
我用winsock控件做了一个服务器,一个客户机,都放在本机上运行 服务器用的是一个winsock控件数组.. ( 首次运行) 能连通 关掉再运行:失败!! (没做任何更改!) 大概5-10分钟后,再运行 能连通!!! 请问各位大侠,这是为什么????? 有什么解决办法?? 是不是关闭时要做一些清扫工作? 怎么清? 部分代码: private sub inittcp() winsock1(0).localport = 20007 winsock1(0).listen for i = 1 to maxcomputer load winsock1(i) next i end sub private sub winsock1_connectionrequest(index as integer, byval requestid as long) msgbox "" dim i as integer for i = 1 to maxcomputer if winsock1(i).state = sckclosed then winsock1(i).accept requestid exit for end if next i end sub private sub winsock1_dataarrival(index as integer, byval bytestotal as long) dim temp$ winsock1(index).getdata temp call processmsg(index, temp) end sub |
|
|
|
|