View Single Post
Old 04-28-2006, 07:27 AM   #5 (permalink)
kyoryu
Registered User
 
Join Date: Apr 2003
Posts: 34
kyoryu is on a distinguished road
You want to tell if you've successfully connected or not, correct?

1) connect() will return < 0 if it fails.
2) if you select on a socket, and it returns readable but has no data, it is closed. It helps to think of select not as determining "do I have data available", but "will I block if I do this?" A closed socket won't block, so it will always return as readable and writable.
kyoryu is offline   Reply With Quote