mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-24 04:27:08 +08:00
feat(tcp): add config option dialtimeout
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
DialTimeout time.Duration
|
||||
PeersTimeout time.Duration
|
||||
ReceiveChannelSize int
|
||||
}
|
||||
@@ -28,6 +29,7 @@ func newEndpoint(endpoint string, configs ...any) *EndPoint {
|
||||
addr: net.TCPAddrFromAddrPort(
|
||||
netip.MustParseAddrPort(endpoint),
|
||||
),
|
||||
dialtimeout: cfg.DialTimeout,
|
||||
peerstimeout: cfg.PeersTimeout,
|
||||
recvchansize: cfg.ReceiveChannelSize,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user