Feature: add experimental connections API

This commit is contained in:
Dreamacro
2019-10-27 21:44:07 +08:00
parent 52cfa94652
commit 207371aeae
16 changed files with 365 additions and 130 deletions

View File

@ -14,7 +14,7 @@ type Pool struct {
min uint32
gateway uint32
offset uint32
mux *sync.Mutex
mux sync.Mutex
cache *cache.LruCache
}
@ -111,7 +111,6 @@ func New(ipnet *net.IPNet, size int) (*Pool, error) {
min: min,
max: max,
gateway: min - 1,
mux: &sync.Mutex{},
cache: cache.NewLRUCache(cache.WithSize(size * 2)),
}, nil
}