@@ -458,6 +458,12 @@ Opening network connections
458
458
*happy_eyeballs_delay *, *interleave *
459
459
and *local_addr * should be specified.
460
460
461
+ .. note ::
462
+
463
+ The *sock * argument transfers ownership of the socket to the
464
+ transport created. To close the socket, call the transport's
465
+ :meth: `~asyncio.BaseTransport.close ` method.
466
+
461
467
* *local_addr *, if given, is a ``(local_host, local_port) `` tuple used
462
468
to bind the socket locally. The *local_host * and *local_port *
463
469
are looked up using ``getaddrinfo() ``, similarly to *host * and *port *.
@@ -556,6 +562,12 @@ Opening network connections
556
562
transport. If specified, *local_addr * and *remote_addr * should be omitted
557
563
(must be :const: `None `).
558
564
565
+ .. note ::
566
+
567
+ The *sock * argument transfers ownership of the socket to the
568
+ transport created. To close the socket, call the transport's
569
+ :meth: `~asyncio.BaseTransport.close ` method.
570
+
559
571
See :ref: `UDP echo client protocol <asyncio-udp-echo-client-protocol >` and
560
572
:ref: `UDP echo server protocol <asyncio-udp-echo-server-protocol >` examples.
561
573
@@ -667,6 +679,12 @@ Creating network servers
667
679
* *sock * can optionally be specified in order to use a preexisting
668
680
socket object. If specified, *host * and *port * must not be specified.
669
681
682
+ .. note ::
683
+
684
+ The *sock * argument transfers ownership of the socket to the
685
+ server created. To close the socket, call the server's
686
+ :meth: `~asyncio.Server.close ` method.
687
+
670
688
* *backlog * is the maximum number of queued connections passed to
671
689
:meth: `~socket.socket.listen ` (defaults to 100).
672
690
@@ -768,6 +786,12 @@ Creating network servers
768
786
* *sock * is a preexisting socket object returned from
769
787
:meth: `socket.accept <socket.socket.accept> `.
770
788
789
+ .. note ::
790
+
791
+ The *sock * argument transfers ownership of the socket to the
792
+ transport created. To close the socket, call the transport's
793
+ :meth: `~asyncio.BaseTransport.close ` method.
794
+
771
795
* *ssl * can be set to an :class: `~ssl.SSLContext ` to enable SSL over
772
796
the accepted connections.
773
797
0 commit comments