当前位置: 技术问答>linux和unix
linux信号处理问题SIGPIPE
来源: 互联网 发布时间:2016-11-24
本文导语: 客户端关闭socket后,服务器在一个线程里调用send函数后 Program received signal SIGPIPE, Broken pipe. [Switching to Thread 0xb75edb90 (LWP 2822)] 0x005cd402 in __kernel_vsyscall () 我在main函数里 调用如下代码 struct sigaction sa;...
客户端关闭socket后,服务器在一个线程里调用send函数后
Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 0xb75edb90 (LWP 2822)]
0x005cd402 in __kernel_vsyscall ()
我在main函数里
调用如下代码
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, 0);
还是会报错
然后哦又在每个线程函数开始加了
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, 0);
还是会出现Program received signal SIGPIPE, Broken pipe.
请教高手了。。。。。
Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 0xb75edb90 (LWP 2822)]
0x005cd402 in __kernel_vsyscall ()
我在main函数里
调用如下代码
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, 0);
还是会报错
然后哦又在每个线程函数开始加了
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, 0);
还是会出现Program received signal SIGPIPE, Broken pipe.
请教高手了。。。。。
|
直接调用signal(SIGPIPE, SIG_IGN);
试试看
试试看
|
不应该呀
是不是某个发送数据的线程漏了加了
是不是某个发送数据的线程漏了加了