Set 'java.rmi.server.hostname' property on client too
The RMI documentation (http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/javarmiproperties.html) says it is useful to set up a `java.rmi.server.hostname` system property on a client and a server. When the property is set up on a client, I saw that "RenewClean" threads stopped listening to my external IP, so all client and server threads are now only listening the loopback interface. I also changed the way the property is set up on the server side: before the change it was passed in jvmargs at a process launcher. I moved this code directly to the main method of the daemon, because it is easy to forget to set up the property, when running the main for debug purposes.
This commit is contained in:
+2
-3
@@ -94,6 +94,7 @@ object KotlinCompilerClient {
|
||||
leaseSession: Boolean,
|
||||
sessionAliveFlagFile: File? = null
|
||||
): ServiceWithSession? = connectLoop(reportingTargets) {
|
||||
setupServerHostName()
|
||||
val (service, newJVMOptions) = tryFindSuitableDaemonOrNewOpts(File(daemonOptions.runFilesPath), compilerId, daemonJVMOptions, { cat, msg -> reportingTargets.report(cat, msg) })
|
||||
if (service != null) {
|
||||
// the newJVMOptions could be checked here for additional parameters, if needed
|
||||
@@ -370,9 +371,7 @@ object KotlinCompilerClient {
|
||||
val javaExecutable = File(File(System.getProperty("java.home"), "bin"), "java")
|
||||
val platformSpecificOptions = listOf(
|
||||
// hide daemon window
|
||||
"-Djava.awt.headless=true",
|
||||
// prevent host name resolution
|
||||
"-Djava.rmi.server.hostname=${LoopbackNetworkInterface.loopbackInetAddressName}")
|
||||
"-Djava.awt.headless=true")
|
||||
val args = listOf(
|
||||
javaExecutable.absolutePath, "-cp", compilerId.compilerClasspath.joinToString(File.pathSeparator)) +
|
||||
platformSpecificOptions +
|
||||
|
||||
Reference in New Issue
Block a user