放置一个timer控件,将间隔设置成你所允许的联接时间, 定义两个布尔型变量boolFlag1,boolFla,2 在winsock的connectionaccept事件里,给boolflag1赋值=true 在timer_timer事件里给boolflag2赋值=true 在调用时写以下语句: timer.enable=true '等待联接 do while boolflag1=false and boolflag2=false doevents loop if boolflag1=true then '已经联接 elseif boolflag2=true then '超时联接 endif
定义两个布尔型变量boolFlag1,boolFla,2
在winsock的connectionaccept事件里,给boolflag1赋值=true
在timer_timer事件里给boolflag2赋值=true
在调用时写以下语句:
timer.enable=true
'等待联接
do while boolflag1=false and boolflag2=false
doevents
loop
if boolflag1=true then
'已经联接
elseif boolflag2=true then
'超时联接
endif