如何在Solaris中抑制SIGPIPE信号 [英] How to supress SIGPIPE signal in solaris

查看:63
本文介绍了如何在Solaris中抑制SIGPIPE信号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,
我已经在solaris 8中使用套接字开发了一个客户端/服务器应用程序. 我面临的问题是,当客户端应用程序关闭时,send()函数导致服务器应用程序崩溃.运行.要解决此问题,SIGPIPE必须被禁止.

并且还发现SO_NOSIGPIPE应该作为最后一个参数传递给
send()抑制信号.
但是当我尝试使用SO_NOSIGPIPE时,它给出了编译错误.我也尝试包括必要的标头,但没有用.

因此,plz谁能帮助我抑制SIGPIPE信号.

谢谢
Dev


I have developed a client/server application using socket in solaris 8.
The problem that I am facing is that the send() funtion is causing the server application to crash when client applcation is down.I googled and figured out the send() function creates SIGPIPE signal and this kills the process if the receiver application is not running.And to fix this SIGPIPE needs to supressed.

And also found that SO_NOSIGPIPE should be passed as the last parameter to the
send() to supress the signal.
But when I tried to use SO_NOSIGPIPE it is giving compilation error.I tried to include the necessary header also, but did not work.

So plz can any one help me in how to supress SIGPIPE signal.

Thanks
Dev

推荐答案

如何使用 sigaction [ ^ ]和SIG_IGN吗?

我还找到了 [
How about using sigaction[^] with SIG_IGN?

I also found This[^] link from google which suggests another (better?) approach.


这篇关于如何在Solaris中抑制SIGPIPE信号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆