I'm using Linux/Ubuntu. I've written a pair of classes that implement a TCP server and TCP client, respectively. Part of the code is to have graceful recovery from disconnects. My only problem is with SIGPIPE. I've written code to capture the signal, but I'd like it to start the "attempt to reconnect" process on the class instance that hit the broken pipe. signal( SIGPIPE, functionname ) requires function name to be C-type function or static class method.
How can I determine which socket the SIGPIPE occurred for if I've got multiple instances of my classes in an application?