From 3fccccf0134bdd54c3d64424fea031fb285c242e Mon Sep 17 00:00:00 2001 From: Jorropo Date: Fri, 28 Aug 2020 22:34:34 +0200 Subject: [PATCH] Doesn't need a new interface, more doc is enough. Closes (partially) libp2p/go-libp2p#999. --- transport/transport.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/transport/transport.go b/transport/transport.go index 99302264..7acb8dd8 100644 --- a/transport/transport.go +++ b/transport/transport.go @@ -81,14 +81,9 @@ type Transport interface { // See the Network interface for an explanation of how this is used. // TODO: Make this a part of the go-multiaddr protocol instead? Proxy() bool -} - -// ClosableTransport is for transport that run a service beyond a listener -// (overlay networks, ...). -type ClosableTransport interface { - Transport - - // Close is called when the libp2p node doesn't need the transport anymore. + + // If your transport implements `io.Closer` Close will be called + // when libp2p doesn't need it anymore. // (libp2p closing, transport unhooked from a node, ...) // // Once a Close is called you can safely assume no more Dial or Listen are @@ -98,7 +93,6 @@ type ClosableTransport interface { // (ex: transport already closed or transport never started). // // No more than one Close will ever be issued on an instance. - Close() error } // Listener is an interface closely resembling the net.Listener interface. The