|
|
От: |
aka50
|
|
| Дата: | 07.12.04 20:17 | ||
| Оценка: | |||
<skip>
EVFILT_READ Takes a descriptor as the identifier, and returns whenever
there is data available to read. The behavior of the fil-
ter is slightly different depending on the descriptor
type.
Sockets
<skip>
Other socket descriptors return when there is data to
be read, subject to the SO_RCVLOWAT value of the
socket buffer. This may be overridden with a per-fil-
ter low water mark at the time the filter is added by
setting the NOTE_LOWAT flag in fflags, and specifying
the new low water mark in data. On return, data con-
tains the number of bytes of protocol data available
to read.
If the read direction of the socket has shutdown, then
the filter also sets EV_EOF in flags, and returns the
socket error (if any) in fflags. It is possible for
EOF to be returned (indicating the connection is gone)
while there is still data pending in the socket
buffer.
<skip>
EVFILT_WRITE Takes a descriptor as the identifier, and returns whenever
it is possible to write to the descriptor. For sockets,
pipes and fifos, data will contain the amount of space
remaining in the write buffer. The filter will set EV_EOF
when the reader disconnects, and for the fifo case, this
may be cleared by use of EV_CLEAR. Note that this filter
is not supported for vnodes or BPF devices.
For sockets, the low water mark and socket error handling
is identical to the EVFILT_READ case.
<skip>