Reputation: 3433
How many OS ports can a single process can hold simultaneously ? Is there any limit ?
I am asking this from the java ServerSocket
context. In my case it is a simulation application in which I created more than one -4 java server sockets listnening to 4 different ports in order to simulate 4 devices which would do the same. That's why I am wondering is there any restriction by OS (I am using Windows 7 ,32 bit)?
Upvotes: 3
Views: 926
Reputation: 5287
Between 1024 - 49152, but the upper limit might be different depending on OS.
Ports 0 - 1023 are reserved by the Internet Engineering Task Force for Assigned Names and Numbers. These are so called well known ports and are to be used by the application end points that communicate using TCP/UDP.
Dynamic ports from range 49152 through 65535 are reserved for outbound requests.
However, it looks strange that you would expose Server on so many ports. It would be highly inconvenient for clients of such Server to keep track of 48129 available ports.
Upvotes: 1