开发者

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

开发者 https://www.devze.com 2023-03-09 03:54 出处:网络
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

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

精彩评论

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