Home SIGPIPE in C++ determining which TCP socket is disconnected
Reply: 0

SIGPIPE in C++ determining which TCP socket is disconnected

user608
1#
user608 Published in April 24, 2018, 6:35 am

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?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308266 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO