summaryrefslogtreecommitdiffhomepage
path: root/src/peer.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/peer.go')
-rw-r--r--src/peer.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/peer.go b/src/peer.go
index 408c605..8eea929 100644
--- a/src/peer.go
+++ b/src/peer.go
@@ -19,9 +19,12 @@ type Peer struct {
keyPairs KeyPairs
handshake Handshake
device *Device
- txBytes uint64
- rxBytes uint64
- time struct {
+ stats struct {
+ txBytes uint64 // bytes send to peer (endpoint)
+ rxBytes uint64 // bytes received from peer
+ lastHandshakeNano int64 // nano seconds since epoch
+ }
+ time struct {
mutex sync.RWMutex
lastSend time.Time // last send message
lastHandshake time.Time // last completed handshake