Winsock and Windows XP

I'm using winsock to scan a subnet for NCTs, using vb6.  It works flawlessly on a windows 2000 PC, but not so good with XP.  With XP, when the program tries to connect to an IP that doesn't exist, it's almost like it keeps trying to connect, even though I closed that winsock and unloaded it.  I can do a netstat -n and see those IPs still there.  This causes my program to quit working all together until XP quits trying to connect to those IPs.  I guess there is a limit to how many simultaneous connections you can make with winsock?  

I've tried just using a single winsock control and scanning one IP at a time, and I've tried it with a winsock array with no luck.  The only way it works is when I put a big pause in between every IP...but it's still inconsistent.  

Is there any other way to stop trying to connect to an IP other than "winsock(x).close"??

Who is Participating?
CetusMODConnect With a Mentor Commented:
PAQed with points refunded (500)

Community Support Moderator
SP2? A new security feature was introduced in that that limits half-opened outgoing connections. SYN is sent to a server and it waits for an ACK so if you try to connect to a host that doesn't exist, "netstat" will list a lot of states of SYN_SENT (half-open) and you'll have to wait for them to time-out.

You may want to try pinging the hosts first.
xviiivxAuthor Commented:
I finally found a "fix".  There's a program called xp anti spy that has an option to increase the number of simultaneous connections.  I'm scanning over 100 IPs at a time, and it is working great.  
"XP Anti Spy" increases the connections which I mentioned was limited by SP2's new security feature. My original comment singled-out their problem to which they found a resolution for.

You can just PAQ & refund, though.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.