linux – Do ephemeral port numbers run in sequence for the whole system, per process or per listening port?

We have an application and we use the ephemeral port number to identify the connection. We listen on two different ports, one for normal connections and one for SSL connections. I want to avoid the situation where the port numbers clash because the OS is assigning the ephemeral port numbers per listening port instead of per process or across the system as whole.

We are hosting on Windows but would like the option to switch to linux at some stage.