versatica / mediasoup

Cutting Edge WebRTC Video Conferencing
https://mediasoup.org
ISC License
6.27k stars 1.13k forks source link

TransportListenInfo: Add portRange (deprecate worker port range) #1365

Closed ibc closed 7 months ago

ibc commented 7 months ago

Details

TODO

ibc commented 7 months ago

@jmillan, minPort and maxPort now moved to portRange.

CosmosisT commented 7 months ago

Why not allowedPorts and provide ability for min/max and static ports. That way everyone is settled. I would assume if isolated processes are ran the min/max range would still be affective skipping used ports for an available one when initiating connections.

The parameter would look a little like this allowedPorts: {min: 20000, max: 30000, static:[443, 3923, 10293]}

This way no matter the setup it's simplified and in one spot and for people who want specifics between TCP/UDP connections this would suffice.

ibc commented 7 months ago

We allow passing a static port (so the app must manage ports by itself) or a port range. IMHO is more than enough. In addition the PortRange C++ class is optimized to avoid trying already used ports.

Also, it doesn't make sense that the app passes some static ports plus a port range. If the app passes a static port then the app is supposed to manage ports. mediasoup is not gonna try first your "maybe available or not" static ports and then, of all fail, choose a random one in the given range. It doesn't make sense.