I'm busy writing an application for work which needs to connect to a list of our servers and check some ports to ensure the correct ones we require are open and ones we don't use are closed.
I'm using winsock and checking for a connection and the results are being written out to a csv file so we can then filter various settings.
if I use a single ip i am fine the program works without a problem, the issues arise when I incorperate a loop to cycle through and only if i use them same sockets repeatedly.
ie: I'm looking at 10 ports on 50 servers
i've set my portlist up and loadup the sockets, then assign the relevant values to winsock then connect. If I connect or not I then close the socket so I can then use on next ip. But it only seems to pull through the last ip in the list, and not the others.
How can I delay the loop long enough for it to do each ip correctly, instead of skipping them