The original UDPMux only works for the HOST candidates.
UniversalUDPMux adds support for SRFLX candidates
and will later support Relay candidates.
UniversalUDPMux embeds UDPMuxDefault and
handles STUN server packets to discover XORMappedAddr
forwarding the remaining packets for muxing to UDPMuxDefault.
It was possible for the Close() function to exit without all goroutines
existing. By closing these channels before the after function, all
goroutines are forced to exit before.
TCP/UDP Mux would have old entries of closed PacketConns from restarted
ICE Agents. Move cleanup code from Closing the ICE Agent into a shared
function and also call it during Restart.
Allow a user to pass a nil Candidate. We perform no actions off of this
currently. Until browsers implement end-of-candidates consistently it
isn't something we can do.
Relates to pion/webrtc#1212 and #271
Enable user to implement the golang.org/x/net/proxy
dialer interface in order to have a customized dialer.
The customized dialer could be one that connect through
a corporate HTTP/HTTPS proxy.
Resolves#284
mDNSConn.Query() will block indefinitely until something replies. Much
of the time, nothing will, and the goroutines making these queries will
block forever. By passing the CandidateHost's context, the queries will
at least be cancelled when the host disconnects.
This addresses a few points issue of #245:
- Take a net.Listener instead of having global state
- Expose a net.TCPMux based API
Also, the unused closeChannel was removed from tcp_mux.go
Closes#253.
Multiple candidate gathering routine were executed in parallel
when Restart() called immediately after previous start of gathering.
Cancel previous gathering by context to prevent mixing candidates
from two routines.
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.
Seeding random generator each time limits number of generated sequence
to 31-bits, and caused collision.
Use global random generator seeded by crypto grade random.
Use crypto/rand for cryptographic values,
and math/rand for unique identifier.
- Use UUIDv4 for mDNS name
- Use crypto/rand for ICE pwd and user fragment
- Use properly seeded math/rand for UDP port,
tie breaker and candidate ID
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
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
Selection before was written in a way that wouldn't work for restarts.
This moves the code out and makes it stateless. In the future we will be
able to clear the candidates and update the ConnectionState and
everything will restart properly.
Relates to #190
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
It seems like mDNS was intended to be opportunistic, but right now,
if creating an mDNS client fails, the whole ICE connection fails.
This allows pion to work in more restricted network namespaces,
or on less supported environments like 9front.
This fixes webwormhole on 9front.
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