Skip to content

Multi UDP Mux can't works when remote also enables Multi UDP Mux #507

Description

@r1a2y3

Your environment.

  • Version: v2.2.12

What did you do?

I wrote sample code to simulcast multi-udp-mux for both of local and remote, such as two sfu cascade and they both use one signal udp port. And it CANNOT work
sample code

https://go.dev/play/p/PfDDj7VnV2g

What did you expect?

It should work

What happened?

I currently think the reason is current code only use remote address as key in map to save udpMuxedConn, but in this case, all of the remote address is same. But I haven't confirm whether the root cause is it or not.

func (m *UDPMuxDefault) registerConnForAddress(conn *udpMuxedConn, addr string) {
	if m.IsClosed() {
		return
	}

	m.addressMapMu.Lock()
	defer m.addressMapMu.Unlock()

	existing, ok := m.addressMap[addr]
	if ok {
		existing.removeAddress(addr)
	}
	m.addressMap[addr] = conn

	m.params.Logger.Debugf("Registered %s for %s", addr, conn.params.Key)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmuxUDP and TCP Mux related issues

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions