What does it mean when "No Buffer space is available" when using Winsock? Is there a way to fix this? I am looping through all the IP addresses on my network to see which machines respond to a connection.
Thanks
-Joey
Printable View
What does it mean when "No Buffer space is available" when using Winsock? Is there a way to fix this? I am looping through all the IP addresses on my network to see which machines respond to a connection.
Thanks
-Joey
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!
Yeah I am closing the winsock at the end of each connect. It just connects long enough to get the IP, adds it to a list then closes the winsock, and continues on. Then, once I am done with that loop I want to loop through the IPs that it found and connect on those machines through my specific port and program, and send the message "SHUTDOWN" then continue through the list.
Just for some background, I am making a program that runs on all the machines in our computer lab at school, and it shuts down all the computers from the teachers computer. He's giving me an A for the semester if I can do this successfully...
Have you tried throwing so DoEvents in there?
Yes I have DoEvents in there, a couple of times actually. I figured out that I just need to allow more time between requests, so I made a little timer function to freeze it while still letting winsock do it's thing:
VB Code:
Private Declare Function GetTickCount Lib "kernel32" () As Long Public Sub Wait(milliseconds As Integer) Dim OldTime As Long OldTime = GetTickCount Do Until GetTickCount >= OldTime + milliseconds DoEvents Loop End Sub