Search code examples
javatcprmi

Setting sun.rmi.transport.tcp.maxConnectionThreads


I'm using Java RMI but I need to restrict the number of simultaneous connections to my server.

I know there are a few sun.rmi properties that define this like sun.rmi.transport.tcp.maxConnectionThreads

but I don't know how to change it since there doesn't seem to be a specific method or clas of properties.


Solution

  • It's a system property. You can change it via the command line, or via System.setProperty(), before you execute any RMI code.