When we have multiple host candidates and mux to a
single port, if these candidates share a same conn
(either tcp or udp), they might read other's msg
cause ice connection cost long time or failed.
Previously `(*TCPMux).RemoveConnByUfrag` would close the connections
while holding its lock, but it is possible for closing to block
and/or take a while.
If closing one of the connections blocks (which was occurring rarely
due to blocking on a channel send), then the entire `TCPMux` would
deadlock and all further operations with the ICE agent would end
up getting blocked due to tying up the task loop.
This change should help matters, but it's unclear if
`(*TCPMux).RemoveConnByUfrag` somehow needs to be made cancelable by
`Agent`'s task context, as there are no guarantees that closing
a connection will happen quickly.
A newline is automatically added by the DefaultLeveledLogger.
The current code-base used a mix of log statements w/o endlines.
This is misleading for custom loggers.
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.