3 ms·
One way you can have a listening port in the ephemeral range is to specify 0 as the port when binding, allowing the system to assign the port for you. You might
by to3m 10y ago
One way you can have a listening port in the ephemeral range is to specify 0 as the port when binding, allowing the system to assign the port for you. You might do this if you're using the socket for some kind of parent<->child IPC. (Pipes might be more usual for this sort of thing, but sockets code is a bit easier to make portable between Windows and POSIX, and you also get the option of running both sides on different systems.)