annotate Doc/library/select.rst @ 54294:dba767bc3155 legacy-trunk

remove mention of old ctypes version
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 May 2009 20:59:09 +0000
parents 82ccc7e77ec5
children c3a26556dd14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
42604
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
1
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
2 :mod:`select` --- Waiting for I/O completion
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
3 ============================================
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
4
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
5 .. module:: select
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
6 :synopsis: Wait for I/O completion on multiple streams.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
7
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
8
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
9 This module provides access to the :cfunc:`select` and :cfunc:`poll` functions
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
10 available in most operating systems, :cfunc:`epoll` available on Linux 2.5+ and
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
11 :cfunc:`kqueue` available on most BSD.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
12 Note that on Windows, it only works for sockets; on other operating systems,
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
13 it also works for other file types (in particular, on Unix, it works on pipes).
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
14 It cannot be used on regular files to determine whether a file has grown since
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
15 it was last read.
42604
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
16
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
17 The module defines the following:
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
18
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
19
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
20 .. exception:: error
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
21
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
22 The exception raised when an error occurs. The accompanying value is a pair
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
23 containing the numeric error code from :cdata:`errno` and the corresponding
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
24 string, as would be printed by the C function :cfunc:`perror`.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
25
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
26
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
27 .. function:: epoll([sizehint=-1])
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
28
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
29 (Only supported on Linux 2.5.44 and newer.) Returns an edge polling object,
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
30 which can be used as Edge or Level Triggered interface for I/O events; see
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
31 section :ref:`epoll-objects` below for the methods supported by epolling
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
32 objects.
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
33
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
34 .. versionadded:: 2.6
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
35
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
36
42604
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
37 .. function:: poll()
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
38
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
39 (Not supported by all operating systems.) Returns a polling object, which
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
40 supports registering and unregistering file descriptors, and then polling them
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
41 for I/O events; see section :ref:`poll-objects` below for the methods supported
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
42 by polling objects.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
43
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
44
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
45 .. function:: kqueue()
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
46
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
47 (Only supported on BSD.) Returns a kernel queue object object; see section
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
48 :ref:`kqueue-objects` below for the methods supported by kqueue objects.
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
49
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
50 .. versionadded:: 2.6
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
51
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
52
49241
50b1e55756a5 #3852: fix some select.kqueue and kevent docs.
Georg Brandl <georg@python.org>
parents: 48166
diff changeset
53 .. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_ADD, fflags=0, data=0, udata=0)
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
54
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
55 (Only supported on BSD.) Returns a kernel event object object; see section
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
56 :ref:`kevent-objects` below for the methods supported by kqueue objects.
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
57
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
58 .. versionadded:: 2.6
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
59
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
60
48166
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
61 .. function:: select(rlist, wlist, xlist[, timeout])
42604
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
62
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
63 This is a straightforward interface to the Unix :cfunc:`select` system call.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
64 The first three arguments are sequences of 'waitable objects': either
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
65 integers representing file descriptors or objects with a parameterless method
48166
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
66 named :meth:`fileno` returning such an integer:
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
67
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
68 * *rlist*: wait until ready for reading
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
69 * *wlist*: wait until ready for writing
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
70 * *xlist*: wait for an "exceptional condition" (see the manual page for what
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
71 your system considers such a condition)
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
72
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
73 Empty sequences are allowed, but acceptance of three empty sequences is
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
74 platform-dependent. (It is known to work on Unix but not on Windows.) The
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
75 optional *timeout* argument specifies a time-out as a floating point number
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
76 in seconds. When the *timeout* argument is omitted the function blocks until
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
77 at least one file descriptor is ready. A time-out value of zero specifies a
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
78 poll and never blocks.
42604
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
79
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
80 The return value is a triple of lists of objects that are ready: subsets of the
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
81 first three arguments. When the time-out is reached without a file descriptor
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
82 becoming ready, three empty lists are returned.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
83
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
84 .. index::
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
85 single: socket() (in module socket)
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
86 single: popen() (in module os)
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
87
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
88 Among the acceptable object types in the sequences are Python file objects (e.g.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
89 ``sys.stdin``, or objects returned by :func:`open` or :func:`os.popen`), socket
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
90 objects returned by :func:`socket.socket`. You may also define a :dfn:`wrapper`
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
91 class yourself, as long as it has an appropriate :meth:`fileno` method (that
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
92 really returns a file descriptor, not just a random integer).
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
93
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
94 .. note::
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
95
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
96 .. index:: single: WinSock
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
97
48166
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
98 File objects on Windows are not acceptable, but sockets are. On Windows,
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
99 the underlying :cfunc:`select` function is provided by the WinSock
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
100 library, and does not handle file descriptors that don't originate from
ab4c9c384d31 Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents: 47937
diff changeset
101 WinSock.
42604
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
102
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
103
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
104 .. _epoll-objects:
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
105
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
106 Edge and Level Trigger Polling (epoll) Objects
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
107 ----------------------------------------------
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
108
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
109 http://linux.die.net/man/4/epoll
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
110
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
111 *eventmask*
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
112
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
113 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
114 | Constant | Meaning |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
115 +=======================+===============================================+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
116 | :const:`EPOLLIN` | Available for read |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
117 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
118 | :const:`EPOLLOUT` | Available for write |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
119 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
120 | :const:`EPOLLPRI` | Urgent data for read |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
121 +-----------------------+-----------------------------------------------+
46370
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 46034
diff changeset
122 | :const:`EPOLLERR` | Error condition happened on the assoc. fd |
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
123 +-----------------------+-----------------------------------------------+
46370
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 46034
diff changeset
124 | :const:`EPOLLHUP` | Hang up happened on the assoc. fd |
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
125 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
126 | :const:`EPOLLET` | Set Edge Trigger behavior, the default is |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
127 | | Level Trigger behavior |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
128 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
129 | :const:`EPOLLONESHOT` | Set one-shot behavior. After one event is |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
130 | | pulled out, the fd is internally disabled |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
131 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
132 | :const:`EPOLLRDNORM` | ??? |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
133 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
134 | :const:`EPOLLRDBAND` | ??? |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
135 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
136 | :const:`EPOLLWRNORM` | ??? |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
137 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
138 | :const:`EPOLLWRBAND` | ??? |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
139 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
140 | :const:`EPOLLMSG` | ??? |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
141 +-----------------------+-----------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
142
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
143
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
144 .. method:: epoll.close()
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
145
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
146 Close the control file descriptor of the epoll object.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
147
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
148
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
149 .. method:: epoll.fileno()
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
150
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
151 Return the file descriptor number of the control fd.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
152
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
153
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
154 .. method:: epoll.fromfd(fd)
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
155
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
156 Create an epoll object from a given file descriptor.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
157
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
158
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
159 .. method:: epoll.register(fd[, eventmask])
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
160
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
161 Register a fd descriptor with the epoll object.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
162
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
163
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
164 .. method:: epoll.modify(fd, eventmask)
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
165
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
166 Modify a register file descriptor.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
167
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
168
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
169 .. method:: epoll.unregister(fd)
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
170
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
171 Remove a registered file descriptor from the epoll object.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
172
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
173
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
174 .. method:: epoll.poll([timeout=-1[, maxevents=-1]])
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
175
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
176 Wait for events. timeout in seconds (float)
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
177
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
178
42604
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
179 .. _poll-objects:
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
180
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
181 Polling Objects
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
182 ---------------
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
183
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
184 The :cfunc:`poll` system call, supported on most Unix systems, provides better
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
185 scalability for network servers that service many, many clients at the same
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
186 time. :cfunc:`poll` scales better because the system call only requires listing
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
187 the file descriptors of interest, while :cfunc:`select` builds a bitmap, turns
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
188 on bits for the fds of interest, and then afterward the whole bitmap has to be
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
189 linearly scanned again. :cfunc:`select` is O(highest file descriptor), while
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
190 :cfunc:`poll` is O(number of file descriptors).
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
191
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
192
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
193 .. method:: poll.register(fd[, eventmask])
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
194
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
195 Register a file descriptor with the polling object. Future calls to the
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
196 :meth:`poll` method will then check whether the file descriptor has any pending
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
197 I/O events. *fd* can be either an integer, or an object with a :meth:`fileno`
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
198 method that returns an integer. File objects implement :meth:`fileno`, so they
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
199 can also be used as the argument.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
200
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
201 *eventmask* is an optional bitmask describing the type of events you want to
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
202 check for, and can be a combination of the constants :const:`POLLIN`,
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
203 :const:`POLLPRI`, and :const:`POLLOUT`, described in the table below. If not
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
204 specified, the default value used will check for all 3 types of events.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
205
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
206 +-------------------+------------------------------------------+
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
207 | Constant | Meaning |
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
208 +===================+==========================================+
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
209 | :const:`POLLIN` | There is data to read |
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
210 +-------------------+------------------------------------------+
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
211 | :const:`POLLPRI` | There is urgent data to read |
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
212 +-------------------+------------------------------------------+
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
213 | :const:`POLLOUT` | Ready for output: writing will not block |
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
214 +-------------------+------------------------------------------+
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
215 | :const:`POLLERR` | Error condition of some sort |
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
216 +-------------------+------------------------------------------+
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
217 | :const:`POLLHUP` | Hung up |
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
218 +-------------------+------------------------------------------+
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
219 | :const:`POLLNVAL` | Invalid request: descriptor not open |
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
220 +-------------------+------------------------------------------+
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
221
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
222 Registering a file descriptor that's already registered is not an error, and has
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
223 the same effect as registering the descriptor exactly once.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
224
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
225
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
226 .. method:: poll.modify(fd, eventmask)
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
227
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
228 Modifies an already registered fd. This has the same effect as
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
229 :meth:`register(fd, eventmask)`. Attempting to modify a file descriptor
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
230 that was never registered causes an :exc:`IOError` exception with errno
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
231 :const:`ENOENT` to be raised.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
232
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
233 .. versionadded:: 2.6
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
234
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
235
42604
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
236 .. method:: poll.unregister(fd)
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
237
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
238 Remove a file descriptor being tracked by a polling object. Just like the
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
239 :meth:`register` method, *fd* can be an integer or an object with a
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
240 :meth:`fileno` method that returns an integer.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
241
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
242 Attempting to remove a file descriptor that was never registered causes a
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
243 :exc:`KeyError` exception to be raised.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
244
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
245
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
246 .. method:: poll.poll([timeout])
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
247
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
248 Polls the set of registered file descriptors, and returns a possibly-empty list
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
249 containing ``(fd, event)`` 2-tuples for the descriptors that have events or
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
250 errors to report. *fd* is the file descriptor, and *event* is a bitmask with
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
251 bits set for the reported events for that descriptor --- :const:`POLLIN` for
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
252 waiting input, :const:`POLLOUT` to indicate that the descriptor can be written
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
253 to, and so forth. An empty list indicates that the call timed out and no file
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
254 descriptors had any events to report. If *timeout* is given, it specifies the
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
255 length of time in milliseconds which the system will wait for events before
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
256 returning. If *timeout* is omitted, negative, or :const:`None`, the call will
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
257 block until there is an event for this poll object.
9e1529bf0442 Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff changeset
258
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
259
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
260 .. _kqueue-objects:
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
261
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
262 Kqueue Objects
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
263 --------------
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
264
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
265 .. method:: kqueue.close()
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
266
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
267 Close the control file descriptor of the kqueue object.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
268
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
269
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
270 .. method:: kqueue.fileno()
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
271
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
272 Return the file descriptor number of the control fd.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
273
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
274
49241
50b1e55756a5 #3852: fix some select.kqueue and kevent docs.
Georg Brandl <georg@python.org>
parents: 48166
diff changeset
275 .. method:: kqueue.fromfd(fd)
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
276
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
277 Create a kqueue object from a given file descriptor.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
278
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
279
49241
50b1e55756a5 #3852: fix some select.kqueue and kevent docs.
Georg Brandl <georg@python.org>
parents: 48166
diff changeset
280 .. method:: kqueue.control(changelist, max_events[, timeout=None]) -> eventlist
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
281
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
282 Low level interface to kevent
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
283
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
284 - changelist must be an iterable of kevent object or None
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
285 - max_events must be 0 or a positive integer
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
286 - timeout in seconds (floats possible)
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
287
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
288
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
289 .. _kevent-objects:
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
290
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
291 Kevent Objects
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
292 --------------
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
293
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
294 http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
295
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
296 .. attribute:: kevent.ident
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
297
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
298 Value used to identify the event. The interpretation depends on the filter
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
299 but it's usually the file descriptor. In the constructor ident can either
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
300 be an int or an object with a fileno() function. kevent stores the integer
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
301 internally.
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
302
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
303 .. attribute:: kevent.filter
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
304
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
305 Name of the kernel filter
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
306
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
307 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
308 | Constant | Meaning |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
309 +===========================+=============================================+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
310 | :const:`KQ_FILTER_READ` | Takes a descriptor and returns whenever |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
311 | | there is data available to read |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
312 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
313 | :const:`KQ_FILTER_WRITE` | Takes a descriptor and returns whenever |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
314 | | there is data available to read |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
315 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
316 | :const:`KQ_FILTER_AIO` | AIO requests |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
317 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
318 | :const:`KQ_FILTER_VNODE` | Returns when one or more of the requested |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
319 | | events watched in *fflag* occurs |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
320 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
321 | :const:`KQ_FILTER_PROC` | Watch for events on a process id |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
322 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
323 | :const:`KQ_FILTER_NETDEV` | Watch for events on a network device |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
324 | | [not available on Mac OS X] |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
325 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
326 | :const:`KQ_FILTER_SIGNAL` | Returns whenever the watched signal is |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
327 | | delivered to the process |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
328 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
329 | :const:`KQ_FILTER_TIMER` | Establishes an arbitrary timer |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
330 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
331
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
332 .. attribute:: kevent.flags
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
333
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
334 Filter action
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
335
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
336 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
337 | Constant | Meaning |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
338 +===========================+=============================================+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
339 | :const:`KQ_EV_ADD` | Adds or modifies an event |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
340 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
341 | :const:`KQ_EV_DELETE` | Removes an event from the queue |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
342 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
343 | :const:`KQ_EV_ENABLE` | Permitscontrol() to returns the event |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
344 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
345 | :const:`KQ_EV_DISABLE` | Disablesevent |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
346 +---------------------------+---------------------------------------------+
47937
38d3a50defec fix various doc typos #3320
Benjamin Peterson <benjamin@python.org>
parents: 46370
diff changeset
347 | :const:`KQ_EV_ONESHOT` | Removes event after first occurrence |
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
348 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
349 | :const:`KQ_EV_CLEAR` | Reset the state after an event is retrieved |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
350 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
351 | :const:`KQ_EV_SYSFLAGS` | internal event |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
352 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
353 | :const:`KQ_EV_FLAG1` | internal event |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
354 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
355 | :const:`KQ_EV_EOF` | Filter specific EOF condition |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
356 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
357 | :const:`KQ_EV_ERROR` | See return values |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
358 +---------------------------+---------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
359
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
360
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
361 .. attribute:: kevent.fflags
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
362
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
363 Filter specific flags
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
364
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
365
49677
82ccc7e77ec5 Merged revisions 66801,66803-66804,66813,66854-66856,66866,66870-66872,66874,66887,66903,66905,66911,66913,66927,66932,66938,66942,66962,66964,66973-66974,66977,66992,66998-66999,67002,67005,67007,67028,67040-67041,67044,67070,67089,67091,67101,67117-67119,67123-67124 via svnmerge from
Georg Brandl <georg@python.org>
parents: 49241
diff changeset
366 :const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
367
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
368 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
369 | Constant | Meaning |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
370 +============================+============================================+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
371 | :const:`KQ_NOTE_LOWAT` | low water mark of a socket buffer |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
372 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
373
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
374
49677
82ccc7e77ec5 Merged revisions 66801,66803-66804,66813,66854-66856,66866,66870-66872,66874,66887,66903,66905,66911,66913,66927,66932,66938,66942,66962,66964,66973-66974,66977,66992,66998-66999,67002,67005,67007,67028,67040-67041,67044,67070,67089,67091,67101,67117-67119,67123-67124 via svnmerge from
Georg Brandl <georg@python.org>
parents: 49241
diff changeset
375 :const:`KQ_FILTER_VNODE` filter flags
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
376
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
377 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
378 | Constant | Meaning |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
379 +============================+============================================+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
380 | :const:`KQ_NOTE_DELETE` | *unlink()* was called |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
381 +----------------------------+--------------------------------------------+
47937
38d3a50defec fix various doc typos #3320
Benjamin Peterson <benjamin@python.org>
parents: 46370
diff changeset
382 | :const:`KQ_NOTE_WRITE` | a write occurred |
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
383 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
384 | :const:`KQ_NOTE_EXTEND` | the file was extended |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
385 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
386 | :const:`KQ_NOTE_ATTRIB` | an attribute was changed |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
387 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
388 | :const:`KQ_NOTE_LINK` | the link count has changed |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
389 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
390 | :const:`KQ_NOTE_RENAME` | the file was renamed |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
391 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
392 | :const:`KQ_NOTE_REVOKE` | access to the file was revoked |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
393 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
394
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
395
49677
82ccc7e77ec5 Merged revisions 66801,66803-66804,66813,66854-66856,66866,66870-66872,66874,66887,66903,66905,66911,66913,66927,66932,66938,66942,66962,66964,66973-66974,66977,66992,66998-66999,67002,67005,67007,67028,67040-67041,67044,67070,67089,67091,67101,67117-67119,67123-67124 via svnmerge from
Georg Brandl <georg@python.org>
parents: 49241
diff changeset
396 :const:`KQ_FILTER_PROC` filter flags
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
397
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
398 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
399 | Constant | Meaning |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
400 +============================+============================================+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
401 | :const:`KQ_NOTE_EXIT` | the process has exited |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
402 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
403 | :const:`KQ_NOTE_FORK` | the process has called *fork()* |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
404 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
405 | :const:`KQ_NOTE_EXEC` | the process has executed a new process |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
406 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
407 | :const:`KQ_NOTE_PCTRLMASK` | internal filter flag |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
408 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
409 | :const:`KQ_NOTE_PDATAMASK` | internal filter flag |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
410 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
411 | :const:`KQ_NOTE_TRACK` | follow a process across *fork()* |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
412 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
413 | :const:`KQ_NOTE_CHILD` | returned on the child process for |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
414 | | *NOTE_TRACK* |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
415 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
416 | :const:`KQ_NOTE_TRACKERR` | unable to attach to a child |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
417 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
418
49677
82ccc7e77ec5 Merged revisions 66801,66803-66804,66813,66854-66856,66866,66870-66872,66874,66887,66903,66905,66911,66913,66927,66932,66938,66942,66962,66964,66973-66974,66977,66992,66998-66999,67002,67005,67007,67028,67040-67041,67044,67070,67089,67091,67101,67117-67119,67123-67124 via svnmerge from
Georg Brandl <georg@python.org>
parents: 49241
diff changeset
419 :const:`KQ_FILTER_NETDEV` filter flags [not available on Mac OS X]
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
420
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
421 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
422 | Constant | Meaning |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
423 +============================+============================================+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
424 | :const:`KQ_NOTE_LINKUP` | link is up |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
425 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
426 | :const:`KQ_NOTE_LINKDOWN` | link is down |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
427 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
428 | :const:`KQ_NOTE_LINKINV` | link state is invalid |
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
429 +----------------------------+--------------------------------------------+
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
430
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
431
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
432 .. attribute:: kevent.data
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
433
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
434 Filter specific data
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
435
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
436
46034
0a485593ae1c Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 45991
diff changeset
437 .. attribute:: kevent.udata
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
438
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 44396
diff changeset
439 User defined value