Skip to content

Commit

Permalink
Doesn't need a new interface, more doc is enough.
Browse files Browse the repository at this point in the history
Closes (partially) libp2p/go-libp2p#999.
  • Loading branch information
Jorropo authored Aug 28, 2020
1 parent b00396b commit 3fccccf
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3fccccf

Please sign in to comment.