Winsock: Stop Connecting
One solution is shutdown() and close().
Depending the network speed, a connection could be as fast as a second. I do not think you could cancel a connect process in less than a second.
Kuphryn
Depending the network speed, a connection could be as fast as a second. I do not think you could cancel a connect process in less than a second.
Kuphryn
If the socket is blocking and you want to stop during a connect() call, you could have another thread call closesocket() on the blocking socket, forcing the connect() to fall through with an error. Afterwards, if the socket is an invalid value, the former thread knows that the connection attempt was forcefully aborted.
________________________________________________"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement