From ad60618cb6c04387179ded7a9c40e32e7083ceec Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Tue, 19 Nov 2019 16:01:16 -0800 Subject: [PATCH] ping --- src/croc/croc.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index b4dbde8f..f0565ed3 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -510,12 +510,17 @@ func (c *Client) CreateOfferer(finished chan<- error) (pc *webrtc.PeerConnection } err = box.Unbundle(string(dcMsg.Data), c.Key, &fd) if err == nil { + lastSignal = time.Now() n, _ := fwrite.Write(fd.Data) bar.Add(n) if time.Since(lastSignal).Seconds() > 1 { sendData([]byte{2, 3, 4}) - lastSignal = time.Now() + time.Sleep(1 * time.Second) + sendData([]byte{2, 3, 4}) + time.Sleep(1 * time.Second) + sendData([]byte{2, 3, 4}) + time.Sleep(1 * time.Second) } } else { log.Error(err)