@@ -468,6 +468,12 @@ Opening network connections
468
468
*happy_eyeballs_delay *, *interleave *
469
469
and *local_addr * should be specified.
470
470
471
+ .. note ::
472
+
473
+ The *sock * argument transfers ownership of the socket to the
474
+ transport created. To close the socket, call the transport's
475
+ :meth: `~asyncio.BaseTransport.close ` method.
476
+
471
477
* *local_addr *, if given, is a ``(local_host, local_port) `` tuple used
472
478
to bind the socket locally. The *local_host * and *local_port *
473
479
are looked up using ``getaddrinfo() ``, similarly to *host * and *port *.
@@ -577,6 +583,12 @@ Opening network connections
577
583
transport. If specified, *local_addr * and *remote_addr * should be omitted
578
584
(must be :const: `None `).
579
585
586
+ .. note ::
587
+
588
+ The *sock * argument transfers ownership of the socket to the
589
+ transport created. To close the socket, call the transport's
590
+ :meth: `~asyncio.BaseTransport.close ` method.
591
+
580
592
See :ref: `UDP echo client protocol <asyncio-udp-echo-client-protocol >` and
581
593
:ref: `UDP echo server protocol <asyncio-udp-echo-server-protocol >` examples.
582
594
@@ -688,6 +700,12 @@ Creating network servers
688
700
* *sock * can optionally be specified in order to use a preexisting
689
701
socket object. If specified, *host * and *port * must not be specified.
690
702
703
+ .. note ::
704
+
705
+ The *sock * argument transfers ownership of the socket to the
706
+ server created. To close the socket, call the server's
707
+ :meth: `~asyncio.Server.close ` method.
708
+
691
709
* *backlog * is the maximum number of queued connections passed to
692
710
:meth: `~socket.socket.listen ` (defaults to 100).
693
711
@@ -789,6 +807,12 @@ Creating network servers
789
807
* *sock * is a preexisting socket object returned from
790
808
:meth: `socket.accept <socket.socket.accept> `.
791
809
810
+ .. note ::
811
+
812
+ The *sock * argument transfers ownership of the socket to the
813
+ transport created. To close the socket, call the transport's
814
+ :meth: `~asyncio.BaseTransport.close ` method.
815
+
792
816
* *ssl * can be set to an :class: `~ssl.SSLContext ` to enable SSL over
793
817
the accepted connections.
794
818
0 commit comments