diff options
-rw-r--r-- | Doc/library/asyncore.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index 58691abd4b..813ac21cf3 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -292,7 +292,7 @@ implement its socket handling:: asyncore Example basic echo server ---------------------------------- -Here is abasic echo server that uses the :class:`dispatcher` class to accept +Here is a basic echo server that uses the :class:`dispatcher` class to accept connections and dispatches the incoming connections to a handler:: import asyncore @@ -302,7 +302,8 @@ connections and dispatches the incoming connections to a handler:: def handle_read(self): data = self.recv(8192) - self.send(data) + if data: + self.send(data) class EchoServer(asyncore.dispatcher): |