@@ -450,6 +450,12 @@ Opening network connections
450
450
*happy_eyeballs_delay *, *interleave *
451
451
and *local_addr * should be specified.
452
452
453
+ .. note ::
454
+
455
+ The *sock * argument transfers ownership of the socket to the
456
+ transport created. To close the socket, call the transport's
457
+ :meth: `~asyncio.BaseTransport.close ` method.
458
+
453
459
* *local_addr *, if given, is a ``(local_host, local_port) `` tuple used
454
460
to bind the socket locally. The *local_host * and *local_port *
455
461
are looked up using ``getaddrinfo() ``, similarly to *host * and *port *.
@@ -555,6 +561,12 @@ Opening network connections
555
561
transport. If specified, *local_addr * and *remote_addr * should be omitted
556
562
(must be :const: `None `).
557
563
564
+ .. note ::
565
+
566
+ The *sock * argument transfers ownership of the socket to the
567
+ transport created. To close the socket, call the transport's
568
+ :meth: `~asyncio.BaseTransport.close ` method.
569
+
558
570
See :ref: `UDP echo client protocol <asyncio-udp-echo-client-protocol >` and
559
571
:ref: `UDP echo server protocol <asyncio-udp-echo-server-protocol >` examples.
560
572
@@ -644,6 +656,12 @@ Creating network servers
644
656
* *sock * can optionally be specified in order to use a preexisting
645
657
socket object. If specified, *host * and *port * must not be specified.
646
658
659
+ .. note ::
660
+
661
+ The *sock * argument transfers ownership of the socket to the
662
+ server created. To close the socket, call the server's
663
+ :meth: `~asyncio.Server.close ` method.
664
+
647
665
* *backlog * is the maximum number of queued connections passed to
648
666
:meth: `~socket.socket.listen ` (defaults to 100).
649
667
@@ -729,6 +747,12 @@ Creating network servers
729
747
* *sock * is a preexisting socket object returned from
730
748
:meth: `socket.accept <socket.socket.accept> `.
731
749
750
+ .. note ::
751
+
752
+ The *sock * argument transfers ownership of the socket to the
753
+ transport created. To close the socket, call the transport's
754
+ :meth: `~asyncio.BaseTransport.close ` method.
755
+
732
756
* *ssl * can be set to an :class: `~ssl.SSLContext ` to enable SSL over
733
757
the accepted connections.
734
758
0 commit comments