PPP and TCP/IP Sockets

Using QNX 6.1, I have an application that talks to another piece of equipment via a serial port. The two ends communicate via TCP/IP over PPP. The two ends communicate fine while the PPP connection is not interrupted.
The problem that I have is that when the PPP connection dies the TCP socket, , at the application, is left connected. When PPP comes back up again, PPP fails to re-negotate the LCP conf reqs, presumably because the still open TCP socket is preventing PPP setup.
I am using blocking sockets and also using select() to detect when data is ready to read and to detect if an exception occurs on the socket (i.e. if the socket goes down due to PPP failing), but I never receive any exceptions and hence the socket stays there, even after PPP has died and PPP never seems to be able to recover. The only way I have found around this is to stop the application and then restart it, i.e. kill the connected TCP socket.
Any Help on this would be very much appreciated.
P.S. I have enabled TCP KEEP Alives on the socket at 5 second intervals but this does not seem to help at all.

Have you been waiting longer enough? TCP KEEP ALIVE at 5 seconds, only means if the tcp connection is idled over 5 seconds, the KEEP ALIVE code will start to PROBE. Only after
the probe failed (timedout), then your application will be notified. If I remember correct,
the timeout will took about 9.5 minutes. There is no option to change this “timeout period”.

If your goal is to unblock yourself if the connection is down in a specific time period,
perhaps you should implement your own hearbeat over your tcp connection.