@@ -1780,27 +1780,34 @@ msgid ""
17801780"except the only supported *mode* values are ``'r'`` (default), ``'w'`` and "
17811781"``'b'``."
17821782msgstr ""
1783+ "返回与套接字关联的 :term:`文件对象 <file object>`。返回的对象的具体类型取决于 :meth:`makefile` "
1784+ "的参数。这些参数的解释方式与内置的 :func:`open` 函数相同,其中 *mode* 的值仅支持 ``'r'`` (默认),``'w'`` 和 "
1785+ "``'b'``。"
17831786
17841787#: ../../library/socket.rst:1292
17851788msgid ""
17861789"The socket must be in blocking mode; it can have a timeout, but the file "
17871790"object's internal buffer may end up in an inconsistent state if a timeout "
17881791"occurs."
1789- msgstr ""
1792+ msgstr "套接字必须处于阻塞模式,它可以有超时,但是如果发生超时,文件对象的内部缓冲区可能会以不一致的状态结尾。 "
17901793
17911794#: ../../library/socket.rst:1296
17921795msgid ""
17931796"Closing the file object returned by :meth:`makefile` won't close the "
17941797"original socket unless all other file objects have been closed and "
17951798":meth:`socket.close` has been called on the socket object."
17961799msgstr ""
1800+ "关闭 :meth:`makefile` 返回的文件对象不会关闭原始套接字,除非所有其他文件对象都已关闭且在套接字对象上调用了 "
1801+ ":meth:`socket.close`。"
17971802
17981803#: ../../library/socket.rst:1302
17991804msgid ""
18001805"On Windows, the file-like object created by :meth:`makefile` cannot be used "
18011806"where a file object with a file descriptor is expected, such as the stream "
18021807"arguments of :meth:`subprocess.Popen`."
18031808msgstr ""
1809+ "在 Windows 上,由 :meth:`makefile` 创建的文件类对象无法作为带文件描述符的文件对象使用,如无法作为 "
1810+ ":meth:`subprocess.Popen` 的流参数。"
18041811
18051812#: ../../library/socket.rst:1309
18061813msgid ""
@@ -1810,12 +1817,14 @@ msgid ""
18101817":manpage:`recv(2)` for the meaning of the optional argument *flags*; it "
18111818"defaults to zero."
18121819msgstr ""
1820+ "从套接字接收数据。返回值是一个字节对象,表示接收到的数据。*bufsize* 指定一次接收的最大数据量。可选参数 *flags* 的含义请参阅 Unix"
1821+ " 手册页 :manpage:`recv(2)`,它默认为零。"
18131822
18141823#: ../../library/socket.rst:1316
18151824msgid ""
18161825"For best match with hardware and network realities, the value of *bufsize* "
18171826"should be a relatively small power of 2, for example, 4096."
1818- msgstr ""
1827+ msgstr "为了最佳匹配硬件和网络的实际情况,*bufsize* 的值应为 2 的相对较小的幂,如 4096。 "
18191828
18201829#: ../../library/socket.rst:1327
18211830msgid ""
@@ -1826,13 +1835,18 @@ msgid ""
18261835"*flags*; it defaults to zero. (The format of *address* depends on the "
18271836"address family --- see above.)"
18281837msgstr ""
1838+ "从套接字接收数据。返回值是一对 ``(bytes, address)``,其中 *bytes* 是字节对象,表示接收到的数据,*address* "
1839+ "是发送端套接字的地址。可选参数 *flags* 的含义请参阅 Unix 手册页 :manpage:`recv(2)`,它默认为零。( *address*"
1840+ " 的格式取决于地址簇 —— 参见上文)"
18291841
18301842#: ../../library/socket.rst:1338
18311843msgid ""
18321844"For multicast IPv6 address, first item of *address* does not contain "
18331845"``%scope`` part anymore. In order to get full IPv6 address use "
18341846":func:`getnameinfo`."
18351847msgstr ""
1848+ "对于多播 IPv6 地址,*address* 的第一项不再包含 ``%scope`` 部分。要获得完整的 IPv6 地址,请使用 "
1849+ ":func:`getnameinfo`。"
18361850
18371851#: ../../library/socket.rst:1345
18381852msgid ""
@@ -1845,6 +1859,10 @@ msgid ""
18451859" *flags* argument defaults to 0 and has the same meaning as for "
18461860":meth:`recv`."
18471861msgstr ""
1862+ "从套接字接收普通数据(至多 *bufsize* 字节)和辅助数据。*ancbufsize* "
1863+ "参数设置用于接收辅助数据的内部缓冲区的大小(以字节为单位),默认为 0,表示不接收辅助数据。可以使用 :func:`CMSG_SPACE` 或 "
1864+ ":func:`CMSG_LEN` 计算辅助数据缓冲区的合适大小,无法放入缓冲区的项目可能会被截断或丢弃。*flags* 参数默认为 0,其含义与 "
1865+ ":meth:`recv` 中的相同。"
18481866
18491867#: ../../library/socket.rst:1355
18501868msgid ""
0 commit comments