remove the ConnHandler (#214)

This commit is contained in:
Marten Seemann 2021-10-18 14:34:50 +02:00 committed by GitHub
parent 96585e594a
commit 1092414cf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,10 +112,6 @@ type Stat struct {
// streams opened by the remote side. // streams opened by the remote side.
type StreamHandler func(Stream) type StreamHandler func(Stream)
// ConnHandler is the type of function used to listen for
// connections opened by the remote side.
type ConnHandler func(Conn)
// Network is the interface used to connect to the outside world. // Network is the interface used to connect to the outside world.
// It dials and listens for connections. it uses a Swarm to pool // It dials and listens for connections. it uses a Swarm to pool
// connections (see swarm pkg, and peerstream.Swarm). Connections // connections (see swarm pkg, and peerstream.Swarm). Connections
@ -128,10 +124,6 @@ type Network interface {
// remote side. This operation is threadsafe. // remote side. This operation is threadsafe.
SetStreamHandler(StreamHandler) SetStreamHandler(StreamHandler)
// SetConnHandler sets the handler for new connections opened by the
// remote side. This operation is threadsafe.
SetConnHandler(ConnHandler)
// NewStream returns a new stream to given peer p. // NewStream returns a new stream to given peer p.
// If there is no connection to p, attempts to create one. // If there is no connection to p, attempts to create one.
NewStream(context.Context, peer.ID) (Stream, error) NewStream(context.Context, peer.ID) (Stream, error)