looked at TTPScan and gets error loading cswsk32.ocx on loading into vb.
You don't need it.... it uses winsock because it's on everyone's computer, the other is there just for the ping sweeper, and it's not needed for the port scanner.
I'll be willing to bet, the error that you are recieving however, is because the socket is still connected. With winsock, you have to use .state (socketwrench has a .connected property) to test if the socket is connected before trying to reconnect. So, you do a loop with a doevents in the middle, and wait for the socket's state to become closed. Another thing to take into consideration, is maybe instead of a for loop, try using a variable that keeps track of which server you are scanning, and when the list of scanned ports completes, if it's the last port to scan for that IP, on the socket's error or connect event, call a socket close (disconnect), and start on the next IP.
The problem with the for loop, is that it doesn't wait. It loops each iteration until it's done, and the only way to get it to stop is to break out of it or use a sleep. The sleep will pause your entire app though, not just the loop. So, we need to look at working with event driven looping. On Error, On Connect, On Close, etc. The socket is a control array, so it's not that difficult to check if we are on a our final port by using the passed "index". Also, I don't know if it makes any difference, but you start your for loop at 1, and i'm wondering if the first IP is at 0?