Will select fail if connection couldn't be established?
Hi,
My client program starts the script that establishes PPP connection in background and continues forward with its own processing. At some point, it calls connect on a non-blocking socket, and also selects the socket for completion of connection before writing. How will my program know if connection could not be established? Does select fail or does it still indicate writablilty if connection fails? Can a timeout be specified on connect?
In some cases, the client program may want to know the reason why the connection could not be established. For eg, if the modem is not connected, if there is no carrier etc. Is there a standard way to catch such errors without blocking the calling process? One workaround is to establish connection in a separate thread. Any other suggestions?
Thanks,
Ruchika
|