Commit Graph

24 Commits

Author SHA1 Message Date
Hugo Arregui
2a0747d42d Fix connection nil pointer
Don't assume connection is present if there is an error in listenUDP
2019-09-07 02:42:10 -04:00
Hugo Arregui
358dc33274 Start a candidate before adding it
This way we ensure the connection will be already present when the
candidate is in the checklist
2019-08-07 18:50:30 +00:00
Sean DuBois
8508d5a6b3 More error handling around interface iteration
If we can't iterate host interfaces give a warning to the user.
Also don't bail early if a single interface fails, other interfaces
might still be in a good condition.

Resolves pion/ice#75
2019-07-18 10:11:34 -07:00
Yutaka Takeda
a1667f5cb7 Fixed unexpected goroutine error
TURN client's loc conn was not closed when agent.Close() was called
Relates to pion/webrtc#740
2019-07-17 11:12:26 -07:00
Hugo Arregui
b3e05469f0 Add vnet support with the new pion/turn client
Relates to pion/webrtc#712
2019-07-15 01:00:21 -07:00
Hugo Arregui
77a03cd608 Use config to create candidate
Use config objects to create candidates + add optional candidateID
2019-06-25 19:30:23 +00:00
Sean DuBois
0116bdd649 Add mDNS Host Candidate support
Relates to pion/webrtc#699
2019-06-21 20:22:21 +08:00
Sean DuBois
acbf5671b7 IP -> Address in public API
ICE RFC specifies this value as `Address` and not IP. We need to fix
this divergence to implement mDNS

Relates to pion/webrtc#699
2019-06-21 20:22:21 +08:00
Aleksandr Razumov
116ba6b111 Add turn client Close support
Fix the goroutine leak.
2019-06-07 20:42:39 -07:00
Sean DuBois
06c58b8883 Fix ServerReflexive race condition
We need to hold the same socket when gathering ServerReflexive
candidates. If we Open -> Close -> Open the port we have selected could
quickly be taken by another process

Resolves #63
2019-06-06 15:34:23 -07:00
Sean DuBois
98502a8695 Use net.Dialer for ServerReflexive candidates
Don't attempt to gather ServerReflexive candidates, instead use
net.Dialer. This properly chooses the correct interface, and still
respects our port restrictions

Resolves #58

Co-authored-by: Konstantin Itskov <konstantin.itskov@kovits.com>
2019-06-05 13:52:10 -07:00
Sean DuBois
cfa4fc76ee Minor checklist cleanup
Add helper function to add localCandidates. Brings down the duplication
and make sure we have a properly formed checklist when we are doing
trickle.

When comparing candidates in findPair do by value, and not address.
Before some candidates were failing to be found because of this.
2019-06-01 00:54:16 -07:00
Sean DuBois
a58a281d3a Improve Gathering error handling
Gather only asserted that it wasn't GatheringStateGathering. This
meant that if gathering was complete it would allow multiple runs.
2019-05-29 16:43:32 -07:00
Konstantin Itskov
ce0a3bd08b Modify gathering process to be parallel
resolves #55
2019-05-29 03:41:09 -04:00
Sean DuBois
2a96a308d5 Initial TURN implementation
This implementation is not fully tested, and we don't
handle all error case yet. We will continue to work on it though.

Tests for send/recv and shutdown are in the works.

Relates to #47
2019-05-27 23:30:50 -07:00
Sean DuBois
78c7f4e989 Return error from GatherCandidates
When OnCandidate handler isn't defined and trickle
is enabled return an error

Relates to #51
2019-05-27 01:23:34 -07:00
Sean DuBois
dc601c0675 Configure Agent only via AgentConfig
Update GatherCandidates to not accept any arguments, it pulls
everything from AgentConfig instead

Relates to #51
2019-05-27 01:23:34 -07:00
Konstantin Itskov
e928d7b932 Add trickle support
Resolves #51
2019-05-27 01:23:34 -07:00
Sean DuBois
63b37975b6 Make Candidate an interface
This change will allow us to have custom logic and members
per interface type. Relay candidates will have a completely different
read loop, and candidate specific state.

Relates to #47
2019-05-24 15:55:42 -07:00
Aleksandr Razumov
35330ae9e7 Use merged pion/stun instead of gortc/stun
The only thing that should be changed after complete merge is version
2019-05-21 15:53:04 -07:00
Aleksandr Razumov
7b33f85353 Merge GetMappedAddressUDP
The GetMappedAddressUDP function was moved from stun v0.2.2, adapted to
gortc API and slightly simplified.
2019-05-21 15:53:04 -07:00
Aleksandr Razumov
d895187fa4 Prepare for stun v2
Using github.com/gortc/stun for now.
Should be easy to change it later.
2019-05-21 15:53:04 -07:00
Adam Kiss
5c0921dbfc Respect port range for srv reflexive candidates
Modified gatherCandidatesReflective to respect port min and max
constraints when allocating connections for server reflexive
candidates.
2019-05-10 23:42:28 +02:00
Sean DuBois
df66c58d56 Shorten agent code
Move code out of agent that is general to dedicated files, no logic
changes just moving.
2019-04-14 10:52:10 -07:00