ssize_t send(int sockfd, const void *buf, size_t len, int flags);
1.send 异常退出,flags可能设置为0了.如果是flag==0, 如果断开连接,这调用send,线程会异常退出.
(1)解决方法设置以下flag, 或者重新处理SIGPIPE也可以解决.
MSG_NOSIGNAL (since Linux 2.2)
Requests not to send SIGPIPE on errors on stream oriented sockets when the other end breaks the connection. The EPIPE
error is still returned.