Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obey Transport protocol #366

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu
* [David Zhao](https://github.com/davidzhao)
* [Juliusz Chroboczek](https://github.com/jech)
* [Jin Gong](https://github.com/cgojin)
* [swagggpickle](https://github.com/swagggpickle)

### License
MIT License - see [LICENSE](LICENSE) for full text
4 changes: 4 additions & 0 deletions gather.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ func (a *Agent) gatherCandidatesSrflx(ctx context.Context, urls []*URL, networkT
}

for i := range urls {
// if transport protocol is TCP assume UDP calls will fail/timeout.
if urls[i].Proto == ProtoTypeTCP {
continue
}
wg.Add(1)
go func(url URL, network string) {
defer wg.Done()
Expand Down
8 changes: 8 additions & 0 deletions gather_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ func TestSTUNTURNConcurrency(t *testing.T) {
Username: "username",
Password: "password",
})
urls = append(urls, &URL{
Scheme: SchemeTypeTURN,
Proto: ProtoTypeTCP,
Host: "127.0.0.1",
Port: serverPort,
Username: "username",
Password: "password",
})

a, err := NewAgent(&AgentConfig{
NetworkTypes: supportedNetworkTypes(),
Expand Down