Commit f9302514 authored by Guido van Rossum's avatar Guido van Rossum

Clarify that flow control works for datagrams, except on BSD.

parent c01a03a2
...@@ -376,8 +376,8 @@ The following callbacks are called on :class:`DatagramProtocol` instances. ...@@ -376,8 +376,8 @@ The following callbacks are called on :class:`DatagramProtocol` instances.
Flow control callbacks Flow control callbacks
---------------------- ----------------------
These callbacks may be called on :class:`Protocol` and These callbacks may be called on :class:`Protocol`,
:class:`SubprocessProtocol` instances: :class:`DatagramProtocol` and :class:`SubprocessProtocol` instances:
.. method:: BaseProtocol.pause_writing() .. method:: BaseProtocol.pause_writing()
...@@ -402,6 +402,15 @@ buffer size reaches the low-water mark. ...@@ -402,6 +402,15 @@ buffer size reaches the low-water mark.
are important to ensure that things go as expected when either are important to ensure that things go as expected when either
mark is zero. 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 Coroutines and protocols
------------------------ ------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment