summaryrefslogtreecommitdiffstatshomepage
path: root/docs/library/select.rst
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-11-09 22:10:02 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-11-09 22:10:32 +0200
commit549c79d11e4343ee6cd857c8cda054194bc78482 (patch)
tree5d25bbd4337498c2736b8e6753083c0969e361a6 /docs/library/select.rst
parent746b752b8efd089c8dd37e615949315973a8d370 (diff)
downloadmicropython-549c79d11e4343ee6cd857c8cda054194bc78482.tar.gz
micropython-549c79d11e4343ee6cd857c8cda054194bc78482.zip
docs/select: Document POLLIN/OUT/ERR/HUP.
Diffstat (limited to 'docs/library/select.rst')
-rw-r--r--docs/library/select.rst20
1 files changed, 13 insertions, 7 deletions
diff --git a/docs/library/select.rst b/docs/library/select.rst
index 7c16b02e96..c24f010e6b 100644
--- a/docs/library/select.rst
+++ b/docs/library/select.rst
@@ -38,8 +38,14 @@ Methods
.. method:: poll.register(obj[, eventmask])
- Register ``obj`` for polling. ``eventmask`` is 1 for read, 2 for
- write, 3 for read-write.
+ Register ``obj`` for polling. ``eventmask`` is logical OR of:
+
+ * ``select.POLLIN`` - data available for reading
+ * ``select.POLLOUT`` - more data can be written
+ * ``select.POLLERR`` - error occurred
+ * ``select.POLLHUP`` - end of stream/connection termination detected
+
+ ``eventmask`` defaults to ``select.POLLIN | select.POLLOUT``.
.. method:: poll.unregister(obj)
@@ -52,10 +58,10 @@ Methods
.. method:: poll.poll([timeout])
Wait for at least one of the registered objects to become ready. Returns
- list of (``obj``, ``event``, ...) tuples, ``event`` element specifying
- whether ``obj`` is ready for reading, writing, or both (see ``register``
- method above). There may be other elements in tuple, depending on platform
- and version, so don't assume that its size is 2. In case of timeout, an
- empty list is returned.
+ list of (``obj``, ``event``, ...) tuples, ``event`` element specifies
+ which events happened with a stream and is a combination of `select.POLL*`
+ constants described above. There may be other elements in tuple, depending
+ on platform and version, so don't assume that its size is 2. In case of
+ timeout, an empty list is returned.
Timeout is in milliseconds.