File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,17 @@ package noise
2
2
3
3
// metrics hold the statistics related to remote peers.
4
4
// We can add any method related to adaptive lookup logic here.
5
+ // Please see [docs] for more information.
6
+ //
7
+ // [docs]: https://arxiv.org/pdf/1509.04417.pdf
5
8
type metrics struct {
6
- handshakeStart uint32
7
- handshakeEnd uint32
8
- latency uint16
9
- bandwidth uint16
9
+ handshakeTime uint32 // how long took the handshake to complete.
10
+ latency uint16 // rtt in ms
11
+ bandwidth uint16 // remote peer bandwidth
12
+ nonce uint16 // nonce ordering factor
13
+ sent uint16 // sent messages
14
+ recv uint16 // received messages
10
15
}
11
16
12
17
// calculate weight
18
+ // builder pattern?
Original file line number Diff line number Diff line change @@ -42,13 +42,13 @@ type packet struct {
42
42
}
43
43
44
44
// peer its the trusty remote peer.
45
- // Keep needed methods to interact with the secured session.
45
+ // Provide needed methods to interact with the secured session.
46
46
type peer struct {
47
47
// the attributes orders matters.
48
48
// ref: https://stackoverflow.com/questions/2113751/sizeof-struct-in-go
49
49
id ID
50
50
s * session
51
- l * metrics
51
+ m * metrics
52
52
pool BytePool
53
53
}
54
54
You can’t perform that action at this time.
0 commit comments