]> granicus.if.org Git - python/commitdiff
Clarify that flow control works for datagrams, except on BSD.
authorGuido van Rossum <guido@python.org>
Mon, 24 Feb 2014 22:31:25 +0000 (14:31 -0800)
committerGuido van Rossum <guido@python.org>
Mon, 24 Feb 2014 22:31:25 +0000 (14:31 -0800)
Doc/library/asyncio-protocol.rst

index dabe7d8f17bf3f99bece107d9ee8eab2c3bb6d72..cbbc1510722a1477b9bd3df8ebaababfc5aeada3 100644 (file)
@@ -376,8 +376,8 @@ The following callbacks are called on :class:`DatagramProtocol` instances.
 Flow control callbacks
 ----------------------
 
-These callbacks may be called on :class:`Protocol` and
-:class:`SubprocessProtocol` instances:
+These callbacks may be called on :class:`Protocol`,
+:class:`DatagramProtocol` and :class:`SubprocessProtocol` instances:
 
 .. method:: BaseProtocol.pause_writing()
 
@@ -402,6 +402,15 @@ buffer size reaches the low-water mark.
    are important to ensure that things go as expected when either
    mark is zero.
 
+.. note::
+   On BSD systems (OS X, FreeBSD, etc.) flow control is not supported
+   for :class:`DatagramProtocol`, because send failures caused by
+   writing too many packets cannot be detected easily.  The socket
+   always appears 'ready' and excess packets are dropped; an
+   :class:`OSError` with errno set to :const:`errno.ENOBUFS` may or
+   may not be raised; if it is raised, it will be reported to
+   :meth:`DatagramProtocol.error_received` but otherwise ignored.
+
 
 Coroutines and protocols
 ------------------------