Add filters for low-level packet and high-level message interception for debugging purposes. Close #4

This commit is contained in:
Kleissner
2021-07-31 17:29:14 +02:00
parent dc54f94351
commit 2937154c8d
8 changed files with 98 additions and 13 deletions

View File

@@ -39,9 +39,6 @@ type DHT struct {
// FilterSearchStatus is called with updates of searches in the DHT
FilterSearchStatus func(client *SearchClient, function, format string, v ...interface{})
// The maximum time to wait for a response to any message in Store, Get, FindNode
TMsgTimeout time.Duration
// TimeoutSearch is the maximum time a search may take.
TimeoutSearch time.Duration
@@ -54,7 +51,6 @@ func NewDHT(self *Node, bits, bucketSize, alpha int) *DHT {
return &DHT{
ht: newHashTable(self, bits, bucketSize),
alpha: alpha,
TMsgTimeout: 2 * time.Second,
FilterSearchStatus: func(client *SearchClient, function, format string, v ...interface{}) {},
TimeoutSearch: 10 * time.Second,
TimeoutIR: 6 * time.Second,