SIGPIPE signal is sent by kernel to programs whose remote end closes or shuts down the socket and your program still tries to send/write operations on closed connection. The default signal handler terminates your program at this situation because of default behavior.

Solution 1:

Ignore the signal using ‘signal(SIGPIPE, SIG_IGN)’

then catch the EPIPE error which will return from the send/write operation due to a broken pipe.

Solution 2:

Pass MSG_NOSIGNAL flag to send(). This is results as same as solution 1

Buy me a beer

Related posts:

  1. Fatal Error Installation ended prematurely because of an error If you get an error like this in an installation...
  2. Failed to access IIS metabase error solution select start -> run write “cmd” and press enter write...
  3. High CPU usage solution for vmware on linux (files on NTFS) If you have high cpu usage problem for your vmware...
  4. Sample Linux Driver (module) I am generally writing linux drivers for embedded systems for...
  5. How to use windows shares with Linux Samba First of all you need to share some directories on...