Shayan
Shayan

Reputation: 2828

Maximum number of socket in java

How many is the maximum number of sockets in java under windows? How can I change it?

Upvotes: 4

Views: 9137

Answers (2)

jarnbjo
jarnbjo

Reputation: 34323

It depends on the configuration of your Windows installation. I don't think that Windows has a process specific limit on the number of TCP connections, but there is a system wide configuration in the registry. You can find an article here, in which the registry keys are described.

Upvotes: 1

Steve
Steve

Reputation: 55635

This is largely dependent on the max number of file descriptors (handles in Windows) the OS is configured for. Each open file or socket uses one file descriptor. In Solaris, for example, 65536 is the default for max fd's. Chances are, there are additional files using the pool of FD's, therefore limiting the upper limit of sockets unless the OS is tuned to increase the number of FD's

In Windows NT/2000/XP (Probably Vista & 7) there should be an entry "FILES=" in \Windows\System32\config.nt (Possibly also a registry setting?) that should give you the max number of file handles.

Here is a more in depth discussion of the limits in Windows:

http://blogs.technet.com/markrussinovich/archive/2009/09/29/3283844.aspx

Upvotes: 3

Related Questions