Hi,
I think some error handling may be missing from connect_callback, as the man
page states, select() returns writable for a connecting fd even if the
connection was not successful:
EINPROGRESS
The socket is non-blocking and the connection can-
not be completed immediately. It is possible to
select(2) for completion by selecting the socket
for writing. After select indicates writability,
use getsockopt(2) to read the SO_ERROR option at
level SOL_SOCKET to determine whether connect com-
pleted successfully (SO_ERROR is zero) or unsuc-
cessfully (SO_ERROR is one of the usual error
codes listed above, explaining the reason for the
failure).
connect_callback doesn't check SO_ERROR.
--
Bazsi
PGP key: http://www.balabit.hu/pgpkey.txt, or finger [EMAIL PROTECTED]