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
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
- 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