How many is the maximum numb开发者_运维百科er of sockets in java under windows? How can I change it?
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
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.
精彩评论