From f23ce6e246cb9f2e02c50b3f6fa531aa37b65013 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 13 Nov 2019 07:38:47 -0800 Subject: [PATCH] update --- src/croc/croc.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index 6e54243..450fbdf 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -421,14 +421,9 @@ func (c *Client) CreateOfferer(finished chan<- error) (pc *webrtc.PeerConnection } log.Debug(float64(fstat.Size()) / float64(time.Since(timeStart).Seconds()) / 1000000) - sendData([]byte{1, 2, 3}) - time.Sleep(100 * time.Millisecond) - sendData([]byte{1, 2, 3}) - time.Sleep(100 * time.Millisecond) - sendData([]byte{1, 2, 3}) - time.Sleep(100 * time.Millisecond) for { - time.Sleep(10 * time.Millisecond) + sendData([]byte{1, 2, 3}) + time.Sleep(100 * time.Millisecond) if readyToEnd { break } @@ -457,6 +452,9 @@ func (c *Client) CreateOfferer(finished chan<- error) (pc *webrtc.PeerConnection // Register the OnMessage to handle incoming messages dc.OnMessage(func(dcMsg webrtc.DataChannelMessage) { var fd FileData + if len(dcMsg.Data) >= 3 { + log.Debugf("%+x", dcMsg.Data[:3]) + } if bytes.Equal(dcMsg.Data, []byte{1, 2, 3}) { log.Debug("received magic") fwrite.Close()