From c405779a4014e50f187047feee47272930e59b0a Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 13 Nov 2019 09:06:58 -0800 Subject: [PATCH] log ice state --- src/croc/croc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index 188bf1b6..4cae7254 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -365,6 +365,10 @@ func (c *Client) CreateOfferer(finished chan<- error) (pc *webrtc.PeerConnection return } + pc.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) { + log.Debugf("ICE Connection State has changed: %s", connectionState.String()) + }) + // Register channel opening handling sendData := func(buf []byte) error { // fmt.Printf("sent message: %x\n", md5.Sum(buf)) @@ -394,7 +398,7 @@ func (c *Client) CreateOfferer(finished chan<- error) (pc *webrtc.PeerConnection timeStart := time.Now() for { for { - time.Sleep(10 * time.Millisecond) + time.Sleep(1 * time.Millisecond) if readyToBegin { break }