From cfab100b7b9f198f89337290a9a72f9884869fb0 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 29 Mar 2021 08:41:49 -0700 Subject: [PATCH] doc: document Close on Transport (#188) fixes libp2p/go-libp2p#999 --- transport/transport.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/transport/transport.go b/transport/transport.go index 39a8fd38..70acbc87 100644 --- a/transport/transport.go +++ b/transport/transport.go @@ -54,6 +54,10 @@ type CapableConn interface { // CapableConn, which means that they have been upgraded to support // stream multiplexing and connection security (encryption and authentication). // +// If a transport implements `io.Closer` (optional), libp2p will call `Close` on +// shutdown. NOTE: `Dial` and `Listen` may be called after or concurrently with +// `Close`. +// // For a conceptual overview, see https://docs.libp2p.io/concepts/transport/ type Transport interface { // Dial dials a remote peer. It should try to reuse local listener