Bug fixed: SIGPIPE handled by write() or send() made the program finish