ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

That code is pretty old, so it's hard to know, but I would guess that the purpose is to avoid the chance of receiving a SIGPIPE due to something bad happening to a socket, which could happen pretty often, given how many sockets we might be using and the variety of network conditions we're running in. As you point out, the default behavior for SIGPIPE is to terminate the program, so if we expect to receive it, then we either need to ignore it or catch it.

I don't see a problem with your workaround of unmasking SIGPIPE and catching it yourself. But you should know that you might get SIGPIPEs that are generated due to roscpp's sockets, as opposed to your own resources.