Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
Changing QCapableConn.Transport() to return QTransport.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorropo committed Feb 29, 2020
1 parent 04acd2c commit 2d4fee4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ var AcceptTimeout = 60 * time.Second
// CapableConn provides accessors for the local and remote multiaddrs used to
// establish the connection and an accessor for the underlying Transport.
type CapableConn interface {
mux.MuxedConn
network.ConnSecurity
network.ConnMultiaddrs
BaseCapableConn

// Transport returns the transport to which this connection belongs.
Transport() Transport
Expand Down Expand Up @@ -75,11 +73,21 @@ type CapableConn interface {
//
// QCapableConn embed CapableConn but with `Quality() uint32` support.
type QCapableConn interface {
CapableConn
BaseCapableConn

// Quality returns the Quality we can expect from the connection to this peer.
// That must be deterministic and fast.
Quality() uint32

// Transport returns the transport to which this connection belongs.
Transport() QTransport
}

// CapableConnBase is used to build `CapableConn` and `QCapableConn`
type BaseCapableConn interface {
mux.MuxedConn
network.ConnSecurity
network.ConnMultiaddrs
}

// Score is used by transport to returns expectation about connection
Expand Down

0 comments on commit 2d4fee4

Please sign in to comment.