Skip to content

five-on-it / apps/server/src/rtc-settings / slicePorts

Function: slicePorts() ​

slicePorts(range, processes, index): string

Defined in: apps/server/src/rtc-settings.ts:63

The index-th of processes slices of a port range, as first-last: the range cut in equal parts, the last taking what is left (40000-40999 for four processes: 40000-40249, 40250-40499 …). A range too small for a port each gives each process the whole range again (they then race for its ports); a range that is none is passed on as it is.

Parameters ​

range ​

string

processes ​

number

index ​

number

Returns ​

string