|
From: Rainer Weikusat on 16 Jun 2008 12:34 As I just had the mispleasure to discover: Assume a connected PF_UNIX datagram socket on Linux (checked w/ 2.6, applies probably to earlier versions, too). 'poll' will return, indicating that the socket is writeable when the amount of memory consumed by skbs owned by it is less than the size of the write buffer of this socket. But there is another parameter, called 'max_ack_backlog', associated with the destination socket and sending a datagram to such a socket when max_ack_backlog datagrams are already queued for it will either block or fail with EAGAIN, regardless of the result of the poll call, which will continue to claim that the socket is writeable, despite it actually isn't. The default value for the max_ack_backlog of such a socket is 10, meaning, this condition is likely to occur. Workarounds would be to either decrease the socket send buffer of the sending socket or increase the max_ack_backlog (unsigned 16-bit integer) to a more reasonable value. An obvious attempt at a fix would be to modify unix_writeable to take the state of a possibly existing peer socket into account before claiming that data can be 'send out' through a particular descriptor. F'up2 colds
|
Pages: 1 Prev: 60-luvulla myytiin jo autoilijoille kaikenlaista kivaa Next: close() a pipe question |