disable the SIGPIPE signal


signal (SIGPIPE, SIG_IGN);

原文地址:https://www.cnblogs.com/greencolor/p/2358671.html