I tested the same testcode (Server - Client) on two systems. In one I am getting a SIGPIPE, in another I am not getting SIGPIPE.
The Test Scenario is something like below:
Client
- Connect to a Server
- Receive Data from Server
- Send Data
- Close the Socket
Server
- Accept Connection from a Server
- Send Data to Client
- Receive Data
- Send Data
- Close the Socket
In one system (Client & Server running on the same system), SIGPIPE is happening randomly on the client or server side.
But, in another system, this problem is not happening with the same test code.
I wonder if broken pipe has something to do with TCP Settings.