This might be a really stupid question, but something I really want to understand.
My understanding is a tcp connections staying open indicates that each of the network devices between the client and server is actively assigning a ephemeral port for the connection so that the response can reach the client correctly.
So when a websocket connection is opened, it should mean that the same tcp connection is staying open as long as the socket is up and all the network devices in between the client and server are actually keeping one of its ephemeral open just to serve one client?
In such cases isn't it probable for the network devices to run out of ephemeral ports?
What am I missing here? Can anyone please guide me so that I can try to get a better understanding of the underlying process here?