08-28-2005, 10:33 AM
No No I know that little bit of code itself doesn't do all that stuff I said, I just meant that's what "a program in general" does.
So after opening the socket, binding it, and setting it to listen...
that's where this bit of code comes in. I'm just trying to see if I understand how that little routine checks/accepts a connection.
It seems that it keeps trying to accept over and over again, failing constantly, until it doesn't fail one time, at which point the connection is accepted. So an alternative to that code would be:
Same thing, right?
So after opening the socket, binding it, and setting it to listen...
that's where this bit of code comes in. I'm just trying to see if I understand how that little routine checks/accepts a connection.
It seems that it keeps trying to accept over and over again, failing constantly, until it doesn't fail one time, at which point the connection is accepted. So an alternative to that code would be:
Code:
Dim AcceptSocket as SOCKET
DO
AcceptSocket=accept(m_socket, null, null)
if AcceptSocket <> socket_error then exit do
LOOP
Same thing, right?