1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-19 01:30:26 +08:00

adjust keep alive pos

This commit is contained in:
fumiama
2022-01-01 15:14:17 +08:00
parent 331e57d221
commit 08d5d74fb5
3 changed files with 11 additions and 16 deletions

View File

@@ -31,8 +31,6 @@ type Link struct {
endpoint *net.UDPAddr
// 本机允许接收/发送的 ip 网段
allowedips []*net.IPNet
// 是否已经调用过 keepAlive
haskeepruning bool
// 是否允许转发
allowtrans bool
// 连接的状态,详见下方 const
@@ -53,7 +51,6 @@ const (
func (m *Me) Connect(peer string) (*Link, error) {
p, ok := m.IsInPeer(net.ParseIP(peer).String())
if ok {
p.keepAlive()
return p, nil
}
return nil, errors.New("peer not exist")