Click to See Complete Forum and Search --> : How can we know why PPP connection failed?


ruchika
09-09-2003, 05:22 PM
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, what should I look for inorder to know that the connection could not be established? Does select 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. I am thinking of creating a thread that establishes PPP connection with the updetach option inorder to catch the errors returned by pppd/chat and not block the main process. Is this the standard way to catch errors returned by PPP and know the connection state or is there another way?

Thanks,
Ruchika

Stuka
09-10-2003, 02:06 PM
Are you using fork/exec to launch the PPP connection script? Does the script exit after the connection is made, or does it continue to run until connection closure?

ruchika
09-10-2003, 04:02 PM
I am using "system" to run the script. The script starts pppd directly by calling usr/sbin/pppd. I am starting pppd without the updetach option, which means that the script does not wait for the deamon to establish the connection. It justs starts the deamon and returns, so the return value of the script does not really tell me if the connection got established or not. The reason I am running the script this way is because I don't want the script to hold the process that calls the script.

Stuka
09-10-2003, 05:00 PM
Just checked up on pppd, and it logs to syslog - you can certainly tweak your syslog settings to break the pppd info out into a separate file, and either point the user to it, or parse it yourself.