Commit Graph

68 Commits

Author SHA1 Message Date
Hugo Arregui
1ff70e0ee1 Initial stats
Add basic candidate and candidate pair stats
2019-06-22 11:55:06 +00: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
Hugo Arregui
bf57064619 Improve nomination
This implements a basic validation schema using a checklist. We try
every pair at least maxTries, and mark it as failed if we don't get a
success response after that many requests. Once we get a success
response, we check if it belongs to the best candidate available so far,
if it does we nominate it, otherwise we continue.

Also, after a given timeout, if no candidate has been nominated, we
simply choose the best valid candidate we got so far (if no candidate is
valid, we mark the connection as failed).

Finally, the nomination request also has a maximum of maxTries, we mark
the connection as failed if after that many attempt we fail to get a
success response.
2019-06-01 00:54:16 -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
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
Sean DuBois
05cad45711 Emit Closed via ConnectionStateCallback
When Close is called on an agent emit 'Closed'
to the connection state callback

Resolves #39
2019-05-09 08:45:11 -07:00
Hugo Arregui
cafd8d7860 Implement regular nomination
In this first iteration we nominate the first valid pair we found.
2019-05-02 14:32:27 -03:00
Sean DuBois
5ca0eeb721 Assert bindingSuccessResponse is non-symmetric
We previously didn't correctly follow [0] This updates
the agent to assert that a bindingSuccessResponse is
for the address it was sent too.

https://tools.ietf.org/html/rfc8445#section-7.2.5.2.1
2019-04-28 17:53:21 -07:00
Sean DuBois
bb69dcb592 Assert that agent isn't started twice
Check was lost, also add tests so we don't regress again
2019-04-25 16:45:38 -07: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
Sean DuBois
217c656222 Assert MessageIntegrity/Username for inbound
When we get an inbound message assert these values, also discard any
other packet types besides binding. In the future we should extend to
handle inbound error messages

Resolves #19
Resolves #21
2019-04-14 01:22:18 -07:00
Sean DuBois
f58e725a2c Send connectivity checks right on agent start
Connectivity checks are done via a Ticker, the inital tick does not
happen immediately (by design) causing the startup time to be the
Duration the Ticker is created with.

This change adds another chan forceCandidateContact that can be used to
force contact at anytime. Currently it is only called on startup, but
could be useful in the future for reuse.

Resolve #15
2019-04-13 11:31:04 -07:00
Sean DuBois
af1bcf662b Mass replace pions -> pion
Pions organization was renamed to pion
2019-04-04 14:22:31 -07:00
Michael MacDonald
dc966e04a9 Move pkg/ice to internal/ice
Avoid exposing any non-standard API.
2019-03-01 08:07:42 -05:00