Commit Graph

36 Commits

Author SHA1 Message Date
Sean DuBois
6e4403794a Implement GetSelectedCandidatePair
Related to pion/webrtc#1713
2021-04-10 16:52:52 -07:00
Pion
8e706b1d41 Update CI configs to v0.4.13
Update lint scripts and CI configs.
2020-11-14 14:32:37 -08:00
Sean DuBois
9f7fab666f Simplify copyCandidate
We can use Marshal/Unmarshal now
2020-10-08 21:26:21 -07:00
Pion
d3e1775d73 Update CI configs to v0.4.7
Update lint scripts and CI configs.
2020-09-26 08:54:24 -07:00
Atsushi Watanabe
b2fbb12d0a Run TestRemoteLocalAddr in VNet
Avoid being affected by bridged network interfaces.
2020-07-05 22:23:59 -07:00
Sam Lancia
a4a53ab443 Agent: Frequent candidate check when connecting
Previously in the connecting phase, a gathered peer reflexive candidate
which is by default nominated after 500mS, would have to wait 2s
(default taskLoopInterval) before being nominated.
2020-07-05 17:45:01 +09:00
Atsushi Watanabe
06922c1601 Refactor agent task runner
- Control blocking tasks by context
- Add tests to check deadlock by calling Close/Restart in
  state change callback
- Remove unnecessary chan
2020-07-05 16:05:45 +09:00
Henry
c51782f04c Implement Transport LocalAddr/RemoteAddr
Instead of always returning nil, pick the adress the selected
pair and return the correct addresses depending on it's type.

Relates to pion/quic#31
2020-07-02 14:10:24 -07:00
Sean DuBois
bd57bd814c Make Credential getters thread safe
GetRemoteUserCredentials and GetLocalUserCredentials were
not thread safe. This puts them both behind a .run
2020-06-29 19:37:25 -07:00
Atsushi Watanabe
47186b5abd Fix timeout check order
Timeout check must be inside the scope of routine leak check.
Routine leak check internally has wait for routine exit which
may causes timeout error in some case.
2020-06-26 11:16:59 -07:00
Atsushi Watanabe
9f7c603344 Fix leak in TestTimeout
Routine and ticker were leaked.
2020-06-26 11:16:59 -07:00
Atsushi Watanabe
ab4eba1707 Add routine leak checks
To find out routine leak source.
2020-06-26 11:16:59 -07:00
Sean DuBois
3b47033146 Remove non-trickle ICE
pion/webrtc@v3 will be trickle by default, so removing
support from here.  Users can easily simulate non-trickle
by setting a OnICECandidate callback.

This just reduces the amount of things we need to test/worry about.
2020-06-25 00:16:58 -07:00
Sean DuBois
5a7603837b Set defaultKeepaliveInterval to 2 seconds
This should be lower then defaultDisconnectTimeout otherwise
we are going to enter disconnected.

Also rename defaultDisconnectTimeout -> defaultDisconnectedTimeout
to make the tense consistent with other options

Resolves #190
2020-06-25 00:16:58 -07:00
Sean DuBois
5cab987ca4 Add an additional done to Agent.run
Callers of run need to be able to cancel their waiting individually.
This would cause hung threads during restart if we attempted to close
a candidate while processing a packet for it.

Before the run would be canceled by the global close, but we can't
depend on that anymore.

Resolves #190
2020-06-25 00:16:58 -07:00
Sean DuBois
f195edb4c1 Implement SetRemoteCredentials and Restart
Add simple tests that check it works E2E

Resolves #190
2020-06-25 00:16:58 -07:00
Sean DuBois
0c308ea365 Rename ConnectionTimeout -> DisconnectTimeout
ICE has two distinct states `Disconnected` and `Failed`. We need to
split out these arguments so that we can control (and test) both.

Relates to #190
2020-06-21 01:06:53 -07:00
Sean DuBois
f1bfc8fea1 Start Agent performance refactor
Remove taskChan and make .run just take an Agent wide mutex and run the
function. These is now a blocking operation so all channels used to
communicate from it must be buffered.

After this we will slowly remove usage of .run and make things more
thread safe.

Relates to #80, #67, #2
2020-03-01 20:25:45 -08:00
Atsushi Watanabe
d001618082 Support WASM build/test
Some tests using net.Conn connection are disabled for now
as it is not fully supported by WASM MVP stage.
2020-01-13 08:51:13 +09:00
Atsushi Watanabe
b8eb3d4ec4 Upgrade golangci-lint to 1.19.1
Fix whitespace error.
Disable dogsled and godox.
2020-01-11 22:58:26 -08:00
Hugo Arregui
e945d4b1f8 Add transport stats
bytes sent and received
2019-08-22 17:57:28 +00: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
f335ea3cc2 Add E2E testing for Srflx and Relay candidates
Using pion/turn add tests for both candidates types

Resolves #47
2019-06-07 20:42:39 -07: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
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
Yutaka Takeda
1e0aa9a494 Fix the test incorrectly failing
Resolves #49
2019-05-24 18:41:20 -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
Sean DuBois
f5e8cc510d Validate inbound success messages
Validate all inbound binding success messages, before
peers could create valid prflx candidates without doing
a full request response

Resolves #21
2019-04-17 10:03:03 -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
Konstantin Itskov
052b3f98c6 Add a customization to control network types
- Fix an issue with ipv6 srflx candidates gathering.
- Add SetNetworkTypes config to SettingEngine to control what network
  types are allowed to be connected.

Resolves #460
2019-03-12 21:36:52 -04:00
Michael MacDonald
dc966e04a9 Move pkg/ice to internal/ice
Avoid exposing any non-standard API.
2019-03-01 08:07:42 -05:00