summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-29 12:33:28 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-29 12:33:28 (GMT)
commit3e48d77bcba1eb5bf569ab7699f8b54775254d0a (patch)
tree7dd2c7fa96b756dddaa828b184b6132a998ddbf8
parent52fa138aac5d9c165eb6aaf64442557e522002ce (diff)
parent54a231d5397bda24257f253eb1aaabf1b741a0b5 (diff)
downloadcpython-3e48d77bcba1eb5bf569ab7699f8b54775254d0a.zip
cpython-3e48d77bcba1eb5bf569ab7699f8b54775254d0a.tar.gz
cpython-3e48d77bcba1eb5bf569ab7699f8b54775254d0a.tar.bz2
Merge 3.4 (asyncio doc)
-rw-r--r--Doc/library/asyncio-protocol.rst8
-rw-r--r--Lib/asyncio/protocols.py5
2 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
index 60776d1..b6fcc48 100644
--- a/Doc/library/asyncio-protocol.rst
+++ b/Doc/library/asyncio-protocol.rst
@@ -374,6 +374,14 @@ The following callbacks are called on :class:`Protocol` instances:
a connection. However, :meth:`eof_received` is called at most once
and, if called, :meth:`data_received` won't be called after it.
+State machine:
+
+ start -> :meth:`~BaseProtocol.connection_made`
+ [-> :meth:`~Protocol.data_received` \*]
+ [-> :meth:`~Protocol.eof_received` ?]
+ -> :meth:`~BaseProtocol.connection_lost` -> end
+
+
Datagram protocols
------------------
diff --git a/Lib/asyncio/protocols.py b/Lib/asyncio/protocols.py
index 52fc25c..80fcac9 100644
--- a/Lib/asyncio/protocols.py
+++ b/Lib/asyncio/protocols.py
@@ -78,6 +78,11 @@ class Protocol(BaseProtocol):
State machine of calls:
start -> CM [-> DR*] [-> ER?] -> CL -> end
+
+ * CM: connection_made()
+ * DR: data_received()
+ * ER: eof_received()
+ * CL: connection_lost()
"""
def data_received(self, data):