Connect() timeout
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
When I do CSocket sock; sock.Connect(place_that_doesn't_exist); Connect waits like half a minute before returning. I could do some kind of multithreading or overlapped IO completion ports (neither of which I have any experience with) but it would work for me just to have it return after a second or two if it can't connect. I was thinking along the lines of something like sock.SetTimeout(500_milliseconds); or setsockopt(sock.m_socket, SO_TIMEOUT, 500_milliseconds); Any suggestions? Thanks! - Alex Griffing