开发者

in send() will it be ok to place the flag MSG_NOSIGNAL?

I've asked a previous question

I'm running a server and a client. A SIGPIPE signal crashed my server because of a broken pipe. I read that the above flag prevents that signal from being raised. My program now works and doesn't crash. But, i wonder what will be the over implicatio开发者_StackOverflow中文版ns. What happens if i prevents SIGPIPE from being raised?


Well, you shouldn't mind: it is just a different way of handling errors.

And using MSG_NOSIGNAL seems more elegant is a better way than ignoring SIGPIPE, since you may need this feature in another place of your program.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜