Commit Graph

13 Commits

Author SHA1 Message Date
cnderrauber
3fda0d0a76 Fix goconst lint error
Fix goconst lint error
2022-10-10 20:22:30 +08:00
cnderrauber
04a6027e93 Use MultiUDPMux to implement listen any address
In #475, import low-level API (ReadMsgUDP) to determine
destination interface for packets received by UDPConn listen
at any(unspecified) address, to fix msg received by incorrect
candidate that shared same ufrags. But the api has compatibility
issues, also not reliable in some special network cases like
AWS/ECS.
So this pr revert that change, and make UDPMuxDefault not
accept Conn listen at unspecified address. Also provide a
NewMultiUDPMuxFromPort helper function to create a MultiUDPMux
to listen at all addresses.
For ice gather, it will use UDPMux's listen address to generate
canidates instead of create it from interfaces.
2022-10-10 20:22:30 +08:00
cnderrauber
93980395c8 Fix muxed conn shared by candidate
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.
2022-09-26 09:26:23 +08:00
Kevin Caffrey
169ff6a7b4 Add multi-port wrappers for UDPMux and TCPMux
These wrappers allow a caller to provide UDPMux and TCPMux instances
to the ICE agent that represent multiple open ports. This can be
desirable in what would otherwise be single-port deployments, as it
increases the chance that one of the fixed ports will not be blocked
by a users firewall.
2022-09-12 15:30:42 -04:00
Sean DuBois
9b523704bb Enable acceptAggressiveNomination by default
Always accept Aggressive Nominations by remote agent

Relates to 18f7a214aa
2022-04-22 15:12:20 -04:00
Antoine Baché
45ff379fd3 Makes UDPMux IPv4/IPv6 aware
UDPMux before only worked with UDP4 traffic.
UDP6 traffic would simply be ignored.

This commit implements 2 connections per ufrag. When requesting a
connection for a ufrag the user must specify if they want IPv4 or IPv6.

Relates to pion/webrtc#1915
2022-03-02 19:02:34 +01:00
Sean DuBois
d3a5bf5488 Clean ufrag from UDP/TCP Mux during ICERestart
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.
2022-01-23 23:09:16 -05:00
cgojin
1f4e18f401 Fix UDPMux logger
If no logger is passed in, it will be created.
Error running webrtc/examples/ice-single-port :
invalid memory address or nil pointer dereference
2021-04-27 14:13:03 +08:00
Sean DuBois
b3b84a5b0a Generalize UDP and TCP Mux
Refactor UDPMux to match TCPMux patterns. The goal is to have a
collection of mux instances and no specific UDP/TCP code

Resolves #350
2021-04-20 14:38:25 -07:00
David Zhao
35f704e2e4 Fix UDPMux read/write race condition
Resolves #351
2021-04-19 18:36:38 -07:00
David Zhao
166ba31563 Improved performance of UDPMux
The previous implementation of UDPMux was dropping
packets due to channel usage in the critical write path.
2021-04-18 13:44:08 -07:00
David Zhao
f7b11daf96 Improve UDPMux performance
improved buffer handling and prevents channel clogging
2021-04-14 14:19:07 -07:00
David Zhao
86d69d6ce5 Single port handling via UDPMux
Allows for ICE to handle connections on a single UDP port
2021-04-12 20:42:10 -07:00