1 million is a bit over the top! the exact number would be 65535!
u could do it this way! load one winsock control onto a form. name it winsock and set its index property to 0.
then type this
Code:
Private Sub Form_Load()
on error resume next
for a = 0 to 65534
load winsock(a)
winsock(a).close
winsock(a).localport = a+1
winsock(a).listen
next a
end sub
Private Sub Winsock_ConnectionRequest(Index As Integer, ByVal requestID As Long)
msgbox "Connection attempt on port " & winsock(index).localport,vbinformation
End Sub
hope this solves the problem