Winsock and Windows XP

Posted on 2006-05-22
Last Modified: 2013-12-25
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"??

Question by:xviiivx
    LVL 17

    Expert Comment

    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.

    Author Comment

    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.  
    LVL 17

    Expert Comment

    "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.

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now