How to prevent SIGPIPEs (or handle them properly)

前端 未结 10 1718
名媛妹妹
名媛妹妹 2020-11-22 07:27

I have a small server program that accepts connections on a TCP or local UNIX socket, reads a simple command and (depending on the command) sends a reply.

The problem

10条回答
  •  别那么骄傲
    2020-11-22 07:58

    Or should I just catch the SIGPIPE with a handler and ignore it?

    I believe that is right on. You want to know when the other end has closed their descriptor and that's what SIGPIPE tells you.

    Sam

提交回复
热议问题