Boost logo

Boost :

From: Jeremy Maitin-Shepard (jbms_at_[hidden])
Date: 2005-12-12 15:59:28


Christopher Kohlhoff <chris_at_[hidden]> writes:

> --- Oliver.Kowalke_at_[hidden] wrote:
>> Only if write/sendto is called on a closed socket SIGPIPE
>> should be blocked by your library. In all other cases the user
>> defined signal handler for SIGPIPE should be called. In your
>> solution the user can only ignore SIGPIPE globally (even if
>> the signal is generated from other sources than sockets) or
>> install its own signal handler - and so be forced to
>> distinguish between SIGPIPE from socket and other sources
>> (problem - multiple sockets; which socket has generated the
>> signal?).

> I agree, what you describe is the ideal solution. However I was
> unable to work out how to ignore the signal just for some
> operations. Can you tell me how to do this?

Yes, simply include the MSG_NOSIGNAL flag in the call to send or sendto.

> [snip]

-- 
Jeremy Maitin-Shepard

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk