m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle16
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java3
2 files changed, 10 insertions, 9 deletions
diff --git a/build.gradle b/build.gradle
index 66c50d1..9d91539 100644
--- a/build.gradle
+++ b/build.gradle
@@ -30,19 +30,19 @@ ext.gossipPeriod = {
return System.getProperty("gossipPeriod") ?: 5 * 1000
}
-ext.UDUPHostname = {
+ext.UDUPServerHostname = {
return System.getProperty("hostname") ?: "localhost"
}
-ext.port = {
+ext.UDUPServerPort = {
return System.getProperty("port") ?: 5999;
}
-ext.timeout = {
+ext.UDUPServerTimeout = {
return System.getProperty("timeout") ?: 5000;
}
-ext.bufsize = {
+ext.UDUPServerBufsize = {
return System.getProperty("bufsize") ?: 512;
}
@@ -89,10 +89,10 @@ task runAgent(type: JavaExec) {
systemProperty 'freshness_period', freshnessPeriod()
systemProperty 'query_period', queryPeriod()
systemProperty 'gossip_period', gossipPeriod()
- systemProperty 'UDUPServer.hostname', UDUPHostname()
- systemProperty 'UDUPServer.port', port()
- systemProperty 'UDUPServer.timeout', port()
- systemProperty 'UDUPServer.bufsize', port()
+ systemProperty 'UDUPServer.hostname', UDUPServerHostname()
+ systemProperty 'UDUPServer.port', UDUPServerPort()
+ systemProperty 'UDUPServer.timeout', UDUPServerTimeout()
+ systemProperty 'UDUPServer.bufsize', UDUPServerBufsize()
}
task runClient(type: JavaExec) {
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java
index 58b55da..7f2ee1f 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java
@@ -62,7 +62,8 @@ public class Agent {
Integer port = Integer.getInteger("UDUPServer.port");
Integer timeout = Integer.getInteger("UDUPServer.timeout");
Integer bufsize = Integer.getInteger("UDUPServer.bufsize");
- UDUPServer server = new UDUPServer(InetAddress.getByName("127.0.0.1"), port, bufsize);
+ InetAddress serverAddr = InetAddress.getByName(System.getProperty("UDUPServer.hostname"));
+ UDUPServer server = new UDUPServer(serverAddr, port, bufsize);
modules.put(ModuleType.UDP, new UDUP(port, timeout, bufsize, server));
return modules;
}