This change adapts pion/ice to use a new interface for most network
related operations. The interface was formerly a simple struct vnet.Net
which was originally intended to facilicate testing. By replacing it
with an interface we have greater flexibility and allow users to hook
into the networking stack by providing their own implementation of
the interface.
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.
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.
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.
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
Before Write would only use the selected pair, now it also uses the best
valid pair. This behavior is specified in the RFC.
```
Before selected pairs have
been produced for a data stream, any valid pair associated with a
component of a data stream can be used for sending and receiving
data for the component
```
Resolves#187
The selected pair must NEVER be cleared. Instead we
should keep sending connectivity checks on it. If we go to failed the
user will then create a new PeerConnection or do an iceRestart.
In the future we may support nominations, but not standardized yet.
This test asserts that we can move from
Connected -> Disconnected -> Connected
Resolves#186