0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00
This commit is contained in:
Zack Scholl 2019-11-19 16:01:16 -08:00
parent 99559e1b6d
commit ad60618cb6

View file

@ -510,12 +510,17 @@ func (c *Client) CreateOfferer(finished chan<- error) (pc *webrtc.PeerConnection
} }
err = box.Unbundle(string(dcMsg.Data), c.Key, &fd) err = box.Unbundle(string(dcMsg.Data), c.Key, &fd)
if err == nil { if err == nil {
lastSignal = time.Now()
n, _ := fwrite.Write(fd.Data) n, _ := fwrite.Write(fd.Data)
bar.Add(n) bar.Add(n)
if time.Since(lastSignal).Seconds() > 1 { if time.Since(lastSignal).Seconds() > 1 {
sendData([]byte{2, 3, 4}) 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 { } else {
log.Error(err) log.Error(err)