We've had lots of postings about how to tell if a network connection
is lost, but I don't recall seeing one about detecting on the UNIX
side if a PC peer has closed the connection. More precisely, if the
PC was turned off, or the application abruptly terminated. I'm using
TCP/IP virtual circuits. If I turn off the PC, the UNIX side detects
no error, will still allow writes to the PC (presumably because a
buffer still has room), and a read will block without error (until
the alarm goes off).
I need to use sockets (not tli), I can't use an embedded
application-level protocol (like a heartbeat), and I/O on both sides
should be blocking. I'd like the UNIX application to get an error
state (or something) from the read() call when the link is lost.
SO_KEEPALIVE doesn't seem to do anything in this case. I'm using
SunOS 4.1.{2,3,4} on Sparc {2,5,10,20}.
Any ideas are appreciated.
Mike
--
Mike Garzione IEX Corporation
Richardson, TX 75080