|
@@ -1,5 +1,7 @@
|
|
package de.tu_darmstadt.tk.SmartHomeNetworkSim.core;
|
|
package de.tu_darmstadt.tk.SmartHomeNetworkSim.core;
|
|
|
|
|
|
|
|
+import java.util.Random;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Representation of connection EndPoints, which allows configuration of timings
|
|
* Representation of connection EndPoints, which allows configuration of timings
|
|
* and if it reacts to incoming traffic or even triggers new connections.
|
|
* and if it reacts to incoming traffic or even triggers new connections.
|
|
@@ -71,12 +73,12 @@ public class Port {
|
|
* @param portNumber Number of the Port
|
|
* @param portNumber Number of the Port
|
|
*/
|
|
*/
|
|
public Port(SmartDevice device, short portNumber){
|
|
public Port(SmartDevice device, short portNumber){
|
|
- status = CLOSED;
|
|
|
|
|
|
+ status = SENDING;
|
|
owner = device;
|
|
owner = device;
|
|
connection = null;
|
|
connection = null;
|
|
- triggerInterval = 1000;
|
|
|
|
|
|
+ setTriggerInterval(new Random().nextInt(1000)+1);
|
|
lastTrigger = 0;
|
|
lastTrigger = 0;
|
|
- jitter = 0;
|
|
|
|
|
|
+ setTriggerInterval(new Random().nextInt(5)+1);
|
|
responseTime = 3;
|
|
responseTime = 3;
|
|
this.portNumber = portNumber;
|
|
this.portNumber = portNumber;
|
|
}
|
|
}
|