mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-30 07:40:25 +08:00
init
This commit is contained in:
@@ -9,10 +9,10 @@ import (
|
||||
)
|
||||
|
||||
func (l *Link) keepAlive() {
|
||||
if l.peer.KeepAlive > 0 && !l.hasKeepRuning {
|
||||
if l.KeepAlive > 0 && !l.hasKeepRuning {
|
||||
l.hasKeepRuning = true
|
||||
go func() {
|
||||
t := time.NewTicker(time.Second * time.Duration(l.peer.KeepAlive))
|
||||
t := time.NewTicker(time.Second * time.Duration(l.KeepAlive))
|
||||
for range t.C {
|
||||
_, _ = l.Write(head.NewPacket(head.ProtoHello, 0, 0, nil))
|
||||
logrus.Infoln("[link.nat] send keep alive packet")
|
||||
|
||||
Reference in New Issue
Block a user