30 #define REMOVE_AT_ONCE 1
32 #define WAIT_CONFIRMATION 3
34 #define TYPE_CHANGE_SESSION 0
35 #define TYPE_REMOVE_TRIGGER 1
62 clientIdentifier.createFromHash(
"Client");
63 myIdentifier.createFromHash(
"Server");
64 insertTrigger(myIdentifier);
72 sendPacket(clientIdentifier, smsg);
76 recordScalar(
"Server packets exchanged", numExchanged);
98 void initializeApp(
int stage);
99 virtual void initializeI3();
101 void handleTimerEvent(cMessage *msg);
110 holdsSession =
false;
111 numForeignPackets = 0;
114 WATCH(numForeignPackets);
115 clientIdentifier.createFromHash(
"Client");
116 serverIdentifier.createFromHash(
"Server");
120 poolIdentifier.createFromHash(
"Pool");
121 poolIdentifier.createRandomSuffix();
122 insertTrigger(poolIdentifier);
134 sendPacket(serverIdentifier, msg);
145 insertTrigger(clientIdentifier,
int(par(
"sessionMobilityType")) !=
DONT_REMOVE);
151 sendPacket(serverIdentifier, newMsg);
163 cMessage *msg =
new cMessage();
165 scheduleAt(simTime() +
int(par(
"sessionTime")), msg);
168 getParentModule()->bubble(
"Got session!");
171 removeTrigger(clientIdentifier);
172 getParentModule()->bubble(
"Got confirmation for erase.");
182 recordScalar(
"Client packets received", numExchanged);
183 recordScalar(
"Client wrong received ", numForeignPackets);
184 recordScalar(
"Client session changed ", numSessions);
191 switch (
int(par(
"sessionMobilityType"))) {
196 removeTrigger(clientIdentifier);
199 cMessage *msg =
new cMessage();
201 scheduleAt(simTime() +
int(par(
"sessionMobilityWait")), msg);
204 holdsSession =
false;
216 sendPacket(sessionId, newMsg);
218 getParentModule()->bubble(
"Ceding session...");
222 getParentModule()->bubble(
"Timer ticked for erase.");
223 removeTrigger(clientIdentifier);
250 insertTrigger(clientIdentifier,
int(par(
"sessionMobilityType")) !=
DONT_REMOVE);
256 sendPacket(serverIdentifier, newMsg);
258 cMessage *msg =
new cMessage();
261 std::cout <<
"Started starts" << endl;
262 scheduleAt(simTime() +
int(par(
"sessionTime")), msg);