@@ -492,7 +492,10 @@ Low-level socket operations
492492
493493.. coroutinemethod :: BaseEventLoop.sock_recv(sock, nbytes)
494494
495- Receive data from the socket. The return value is a bytes object
495+ Receive data from the socket. Modeled after blocking
496+ :meth: `socket.socket.recv ` method.
497+
498+ The return value is a bytes object
496499 representing the data received. The maximum amount of data to be received
497500 at once is specified by *nbytes *.
498501
@@ -501,13 +504,12 @@ Low-level socket operations
501504
502505 This method is a :ref: `coroutine <coroutine >`.
503506
504- .. seealso ::
505-
506- The :meth: `socket.socket.recv ` method.
507-
508507.. coroutinemethod :: BaseEventLoop.sock_sendall(sock, data)
509508
510- Send data to the socket. The socket must be connected to a remote socket.
509+ Send data to the socket. Modeled after blocking
510+ :meth: `socket.socket.sendall ` method.
511+
512+ The socket must be connected to a remote socket.
511513 This method continues to send data from *data * until either all data has
512514 been sent or an error occurs. ``None `` is returned on success. On error,
513515 an exception is raised, and there is no way to determine how much data, if
@@ -518,35 +520,35 @@ Low-level socket operations
518520
519521 This method is a :ref: `coroutine <coroutine >`.
520522
521- .. seealso ::
522-
523- The :meth: `socket.socket.sendall ` method.
524-
525523.. coroutinemethod :: BaseEventLoop.sock_connect(sock, address)
526524
527- Connect to a remote socket at *address *.
528-
529- The *address * must be already resolved to avoid the trap of hanging the
530- entire event loop when the address requires doing a DNS lookup. For
531- example, it must be an IP address, not a hostname, for
532- :py:data: `~socket.AF_INET ` and :py:data: `~socket.AF_INET6 ` address families.
533- Use :meth: `getaddrinfo ` to resolve the hostname asynchronously.
525+ Connect to a remote socket at *address *. Modeled after
526+ blocking :meth: `socket.socket.connect ` method.
534527
535528 With :class: `SelectorEventLoop ` event loop, the socket *sock * must be
536529 non-blocking.
537530
538531 This method is a :ref: `coroutine <coroutine >`.
539532
533+ .. versionchanged :: 3.5.2
534+ ``address `` no longer needs to be resolved. ``sock_connect ``
535+ will try to check if the *address * is already resolved by calling
536+ :func: `socket.inet_pton `. If not,
537+ :meth: `BaseEventLoop.getaddrinfo ` will be used to resolve the
538+ *address *.
539+
540540 .. seealso ::
541541
542- The :meth: `BaseEventLoop.create_connection ` method, the
543- :func: `open_connection ` function and the :meth: `socket.socket.connect `
544- method.
542+ :meth: `BaseEventLoop.create_connection `
543+ and :func: `asyncio.open_connection() <open_connection> `.
545544
546545
547546.. coroutinemethod :: BaseEventLoop.sock_accept(sock)
548547
549- Accept a connection. The socket must be bound to an address and listening
548+ Accept a connection. Modeled after blocking
549+ :meth: `socket.socket.accept `.
550+
551+ The socket must be bound to an address and listening
550552 for connections. The return value is a pair ``(conn, address) `` where *conn *
551553 is a *new * socket object usable to send and receive data on the connection,
552554 and *address * is the address bound to the socket on the other end of the
@@ -558,8 +560,7 @@ Low-level socket operations
558560
559561 .. seealso ::
560562
561- The :meth: `BaseEventLoop.create_server ` method, the :func: `start_server `
562- function and the :meth: `socket.socket.accept ` method.
563+ :meth: `BaseEventLoop.create_server ` and :func: `start_server `.
563564
564565
565566Resolve host name
0 commit comments