From b778cef848eab1348ad56b127b80d0def3a688b8 Mon Sep 17 00:00:00 2001 From: Mahmoud Hashemi Date: Sun, 1 May 2016 01:42:46 -0700 Subject: [PATCH] a couple docs/comment tweaks --- boltons/socketutils.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/boltons/socketutils.py b/boltons/socketutils.py index 943bd5b..c9a5fe3 100644 --- a/boltons/socketutils.py +++ b/boltons/socketutils.py @@ -226,6 +226,10 @@ class BufferedSocket(object): """Receive until the connection is closed, up to *maxsize* bytes. If more than *maxsize* bytes are received, raises :exc:`MessageTooLong`. """ + # recv_close works by using recv_size to request maxsize data, + # and ignoring ConnectionClose, returning and clearing the + # internal buffer instead. It raises an exception if + # ConnectionClosed isn't raised. with self._recv_lock: if maxsize is _UNSET: maxsize = self.maxsize @@ -481,9 +485,12 @@ class BufferedSocket(object): @property def proto(self): - """A passthrough to the wrapped socket's protocol. Nobody ever uses - this, so it's always 0, specifying "the default" protocol. You - can go back to not knowing this existed. + """A passthrough to the wrapped socket's protocol. The ``proto`` + attribute is very rarely used, so it's always 0, meaning "the + default" protocol. Pretty much all the practical information + is in :attr:`~BufferedSocket.type` and + :attr:`~BufferedSocket.family`, so you can go back to never + thinking about this. """ return self.sock.proto