Are you closing Winsock each time, becuase it uses a buffer to hold connection attempts I think. When looping through all the I.P address's try and clear Winsocks memory by closing it each time or something similar. Hope it helps!