The trick that can be used to receive EOL events when ignoring all READ events is to deliver a ridiculously high NOTE_LOWAT, thereby suppressing all READ events.
, PPL REPL:
Python 2.6.5 (r265:79063, Jul 17 2010, 22:57:01)
[GCC 4.2.1 20070719 [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.
>>> import select
>>> import socket
>>> import sys
>>> a, b = socket.socketpair()
>>> kq = select.kqueue()
>>> kq.control([select.kevent(a, select.KQ_FILTER_READ, select.KQ_EV_ADD, select.KQ_NOTE_LOWAT, sys.maxint)], 0)
[]
>>> b.send('abc')
3
>>> kq.control(None, 10)
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyboardInterrupt
>>> b.close()
>>> kq.control(None, 10)
[<select.kevent ident=3 filter=-1 flags=0x8000 fflags=0x0 data=0x3 udata=0x0>]
>>>
, FreeBSD , man 2 select:
- .