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.
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
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.
Allow users to pass in a static MulticastDNSHostName, this can be used to
connect peers in a LAN without signaling. If you set a static uFrag/uPwd
on either side and have a static hostname you can gather without knowing
an IP Address on either side.