-
Notifications
You must be signed in to change notification settings - Fork 8
Expose underlying transport connection stat where available #71
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm. Just need to release & update deps & then fix conflicts.
@@ -66,6 +66,11 @@ func (u *Upgrader) UpgradeInbound(ctx context.Context, t transport.Transport, ma | |||
} | |||
|
|||
func (u *Upgrader) upgrade(ctx context.Context, t transport.Transport, maconn manet.Conn, p peer.ID, dir network.Direction) (transport.CapableConn, error) { | |||
var stat network.Stat | |||
if cs, ok := maconn.(network.ConnStat); ok { | |||
stat = cs.Stat() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could just call this on-demand. Not critical but the results from Stat
may not always be constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice indeed, but right now it wouldn't buy us much the way the swarm treats the stat object. That could change too of course if we want to expose dynamic stat information.
depends on libp2p/go-libp2p-core#175
TODO