|
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.
|