tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kqueue



On Mon, Jan 18, 2010 at 09:04:29PM +0000, Sad Clouds wrote:
> EVFILT_READ
> 
> Other socket descriptors return when there is data to be read, subject to the 
> SO_RCVLOWAT value of the socket buffer.
> 
> So it seems to suggest that kevent always returns as long as socket is 
> readable. If I call kevent and it returns with 600 bytes of data, and then I 
> call kevent again with the socket still holding 600 bytes of the same data, 
> kevent will return as before.

I think there is a slight confusion here. Let's say have first
registered the filter and do a second call to kevent to check if the
filter triggered. It returned with the 600 Bytes of data and keeps the
original filter still in place. The state of the filter doesn't change,
just because the event was read from the kqueue. If you want such
behavior, I think you have to set EV_CLEAR. This basic assumption here
is that the application knows what it is doing. If it doesn't handle an
event directly, it has a good reason, e.g. it is waiting for something
else.

Joerg


Home | Main Index | Thread Index | Old Index