VirtualPacketConn: New Stats field maintained by caller. This allows insight into active transfers.

New FileTransferStats and BlockTransferStats structures.
This commit is contained in:
Kleissner
2022-03-16 23:52:55 +01:00
parent 51336263f5
commit cb1441c97a
8 changed files with 88 additions and 35 deletions

View File

@@ -186,3 +186,14 @@ func (router *LiteRouter) RegisterLiteID(id uuid.UUID, data interface{}, timeout
return
}
// Returns all lite sessions
func (router *LiteRouter) All() (sessions []*LiteID) {
router.Lock()
for _, info := range router.ids {
sessions = append(sessions, info)
}
router.Unlock()
return sessions
}