1
0
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:
源文雨
2024-07-16 22:16:01 +09:00
parent 739cf863f1
commit 5d04567ec9
3 changed files with 29 additions and 5 deletions

View File

@@ -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,
}