mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2025-01-28 04:30:08 +08:00
abstract Conn Stat interface for threading
This commit is contained in:
parent
ac2ecf385a
commit
a21b06e646
@ -19,6 +19,7 @@ type Conn interface {
|
|||||||
|
|
||||||
ConnSecurity
|
ConnSecurity
|
||||||
ConnMultiaddrs
|
ConnMultiaddrs
|
||||||
|
ConnStat
|
||||||
|
|
||||||
// ID returns an identifier that uniquely identifies this Conn within this
|
// ID returns an identifier that uniquely identifies this Conn within this
|
||||||
// host, during this run. Connection IDs may repeat across restarts.
|
// host, during this run. Connection IDs may repeat across restarts.
|
||||||
@ -29,9 +30,6 @@ type Conn interface {
|
|||||||
|
|
||||||
// GetStreams returns all open streams over this conn.
|
// GetStreams returns all open streams over this conn.
|
||||||
GetStreams() []Stream
|
GetStreams() []Stream
|
||||||
|
|
||||||
// Stat stores metadata pertaining to this conn.
|
|
||||||
Stat() Stat
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConnSecurity is the interface that one can mix into a connection interface to
|
// ConnSecurity is the interface that one can mix into a connection interface to
|
||||||
@ -61,3 +59,8 @@ type ConnMultiaddrs interface {
|
|||||||
// with this connection
|
// with this connection
|
||||||
RemoteMultiaddr() ma.Multiaddr
|
RemoteMultiaddr() ma.Multiaddr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ConnStat interface {
|
||||||
|
// Stat stores metadata pertaining to this conn.
|
||||||
|
Stat() Stat
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user