Okay, this is for using in something like a winsock array(it will limit the max winsocks to 300, more than enough):
VB Code:
Private Sub Query() On Error GoTo errhandler Dim I as long, MyCount as long For i = 0 To UBound(Servers) Doevents MyCount = MyCount + 1 If MyCount >= 300 Then MyCount = 0 If i > 0 And MyCount < 300 Then If Winsock1(MyCount - 1).Tag <> "" Then Load Winsock1(MyCount - 1) End If End If With winsock(MyCount - 1) .RemoteHost = Server.ip .RemotePort = Server.port .SendData "MESSAGE" End with Next i Exit Sub errhndler: If Err.Number = 340 Then Resume Next End If![]()





Reply With Quote