MCPcopy Create free account
hub / github.com/akeranen/the-one / messageTransferred

Method messageTransferred

routing/SprayAndWaitRouter.java:58–76  ·  view source on GitHub ↗
(String id, DTNHost from)

Source from the content-addressed store, hash-verified

56 }
57
58 @Override
59 public Message messageTransferred(String id, DTNHost from) {
60 Message msg = super.messageTransferred(id, from);
61 Integer nrofCopies = (Integer)msg.getProperty(MSG_COUNT_PROPERTY);
62
63 assert nrofCopies != null : "Not a SnW message: " + msg;
64
65 if (isBinary) {
66 /* in binary S'n'W the receiving node gets ceil(n/2) copies */
67 nrofCopies = (int)Math.ceil(nrofCopies/2.0);
68 }
69 else {
70 /* in standard S'n'W the receiving node gets only single copy */
71 nrofCopies = 1;
72 }
73
74 msg.updateProperty(MSG_COUNT_PROPERTY, nrofCopies);
75 return msg;
76 }
77
78 @Override
79 public boolean createNewMessage(Message msg) {

Callers

nothing calls this directly

Calls 3

getPropertyMethod · 0.95
updatePropertyMethod · 0.95
messageTransferredMethod · 0.65

Tested by

no test coverage detected