Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/candidate_relay.go b/candidate_relay.go
index 12f9f92..769af0d 100644
--- a/candidate_relay.go
+++ b/candidate_relay.go
@@ -2,6 +2,7 @@ package ice
import (
"errors"
+ "fmt"
"io"
"net"
@@ -71,13 +72,18 @@ func (c *CandidateRelay) addPermission(dst Candidate) error {
c.lock.Lock()
c.permissions[dst.String()] = permission
+ err = c.permissions[dst.String()].Bind()
c.lock.Unlock()
+ if err != nil {
+ return err
+ }
go func(remoteAddr net.Addr) {
log := c.agent().log
buffer := make([]byte, receiveMTU)
for {
n, err := permission.Read(buffer)
+ fmt.Printf("from permission %d \n", n)
if err != nil {
return
}
@@ -94,5 +100,6 @@ func (c *CandidateRelay) writeTo(raw []byte, dst Candidate) (int, error) {
return 0, errors.New("no permission created for remote candidate")
}
+ fmt.Printf("to permission %d \n", len(raw))
return permission.Write(raw)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.