From: R David Murray Date: Wed, 7 Sep 2016 18:09:51 +0000 (-0400) Subject: #26209: Clarify type of *localaddr*/*remoteadr* in smtpd docs. X-Git-Tag: v2.7.13rc1~163 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=039f1846543c18810a65bfd0e52c0cdcd46cad08;p=python #26209: Clarify type of *localaddr*/*remoteadr* in smtpd docs. --- diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst index ebb0b302d2..7d6534b388 100644 --- a/Doc/library/smtpd.rst +++ b/Doc/library/smtpd.rst @@ -23,9 +23,10 @@ SMTPServer Objects .. class:: SMTPServer(localaddr, remoteaddr) Create a new :class:`SMTPServer` object, which binds to local address - *localaddr*. It will treat *remoteaddr* as an upstream SMTP relayer. It - inherits from :class:`asyncore.dispatcher`, and so will insert itself into - :mod:`asyncore`'s event loop on instantiation. + *localaddr*. It will treat *remoteaddr* as an upstream SMTP relayer. Both + *localaddr* and *remoteaddr* should be a :ref:`(host, port) ` + tuple. The object inherits from :class:`asyncore.dispatcher`, and so will + insert itself into :mod:`asyncore`'s event loop on instantiation. .. method:: process_message(peer, mailfrom, rcpttos, data) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 73b5d5c9d8..aff6a2e06e 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -34,6 +34,8 @@ in the C interface: as with :meth:`read` and :meth:`write` operations on Python files, buffer allocation on receive operations is automatic, and buffer length is implicit on send operations. +.. _host_port: + Socket addresses are represented as follows: A single string is used for the :const:`AF_UNIX` address family. A pair ``(host, port)`` is used for the :const:`AF_INET` address family, where *host* is a string representing either a