func (l *listener) Close() error {
	err := l.Listener.Close()
	l.cancel()
	for c := range l.incoming {
		c.Close()
	}
	return err
}
Close closes the listener.
package stream
import (
	"context"
	"fmt"
	"sync"
	"github.com/libp2p/go-libp2p-core/network"
	"github.com/libp2p/go-libp2p-core/transport"
	logging "github.com/ipfs/go-log/v2"
	tec "github.com/jbenet/go-temp-err-catcher"
	manet "github.com/multiformats/go-multiaddr/net"
)
var log = logging.Logger("stream-upgrader")
type listener struct {
	manet.Listener
	transport transport.Transport
	upgrader  *Upgrader
	incoming chan transport.CapableConn
	err      error
	threshold *threshold
	ctx    context.Context
	cancel func()
}