@@ -1145,12 +1145,21 @@ convenient.
11451145
11461146 *sock * must be a non-blocking socket.
11471147
1148+ With :class: `SelectorEventLoop `, *address * does not need to be resolved:
1149+ for :const: `~socket.AF_INET ` and :const: `~socket.AF_INET6 ` sockets,
1150+ ``sock_connect `` first checks whether *address * is already resolved by
1151+ calling :func: `socket.inet_pton `, and uses :meth: `loop.getaddrinfo ` to
1152+ resolve it if it is not.
1153+
1154+ :class: `ProactorEventLoop `, the default event loop on Windows, does not
1155+ resolve *address *. The host must already be a numeric IP address; passing
1156+ a host name raises :exc: `OSError `. Resolve the address with
1157+ :meth: `loop.getaddrinfo ` first, or use :meth: `loop.create_connection `,
1158+ which resolves the address on every platform.
1159+
11481160 .. versionchanged :: 3.5.2
1149- ``address `` no longer needs to be resolved. ``sock_connect ``
1150- will try to check if the *address * is already resolved by calling
1151- :func: `socket.inet_pton `. If not,
1152- :meth: `loop.getaddrinfo ` will be used to resolve the
1153- *address *.
1161+ With :class: `SelectorEventLoop `, ``address `` no longer needs to be
1162+ resolved.
11541163
11551164 .. seealso ::
11561165
@@ -1254,7 +1263,9 @@ Working with pipes
12541263 *protocol_factory * must be a callable returning an
12551264 :ref: `asyncio protocol <asyncio-protocol >` implementation.
12561265
1257- *pipe * is a :term: `file-like object <file object> `.
1266+ *pipe * is a :term: `file-like object <file object> `. See
1267+ :ref: `Supported pipe objects <asyncio-pipe-objects >` for the objects
1268+ supported as *pipe *.
12581269
12591270 Return pair ``(transport, protocol) ``, where *transport * supports
12601271 the :class: `ReadTransport ` interface and *protocol * is an object
@@ -1271,7 +1282,9 @@ Working with pipes
12711282 *protocol_factory * must be a callable returning an
12721283 :ref: `asyncio protocol <asyncio-protocol >` implementation.
12731284
1274- *pipe * is :term: `file-like object <file object> `.
1285+ *pipe * is a :term: `file-like object <file object> `. See
1286+ :ref: `Supported pipe objects <asyncio-pipe-objects >` for the objects
1287+ supported as *pipe *.
12751288
12761289 Return pair ``(transport, protocol) ``, where *transport * supports
12771290 :class: `WriteTransport ` interface and *protocol * is an object
@@ -1280,6 +1293,33 @@ Working with pipes
12801293 With :class: `SelectorEventLoop ` event loop, the *pipe * is set to
12811294 non-blocking mode.
12821295
1296+ .. _asyncio-pipe-objects :
1297+
1298+ .. rubric :: Supported pipe objects
1299+
1300+ These methods only work with objects the operating system can poll for
1301+ readiness or perform overlapped I/O on. Regular files on disk are **not **
1302+ supported on any platform. There is no asynchronous file I/O in asyncio;
1303+ use :meth: `loop.run_in_executor ` to read and write regular files without
1304+ blocking the event loop.
1305+
1306+ On Unix, with :class: `SelectorEventLoop `, *pipe * must wrap one of the
1307+ following:
1308+
1309+ * a pipe, such as an end of an :func: `os.pipe ` pair or a FIFO created with
1310+ :func: `os.mkfifo `;
1311+ * a socket;
1312+ * a character device, such as a terminal.
1313+
1314+ On Windows, where only :class: `ProactorEventLoop ` implements these methods,
1315+ *pipe * must wrap a handle opened for overlapped I/O (that is, created with the
1316+ ``FILE_FLAG_OVERLAPPED `` flag), since the handle has to be associated with an
1317+ I/O completion port. Handles that were not opened for overlapped I/O are
1318+ rejected. In particular, the standard streams (:data: `sys.stdin `,
1319+ :data: `sys.stdout ` and :data: `sys.stderr `), console handles, and the pipes
1320+ created by :func: `os.pipe ` are **not ** opened for overlapped I/O and therefore
1321+ cannot be used with these methods.
1322+
12831323.. note ::
12841324
12851325 :class: `SelectorEventLoop ` does not support the above methods on
0 commit comments