Created
June 10, 2019 07:17
-
-
Save Sean-Der/89294713f5194304da9661bd584eef48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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