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

Method messageTransferred

routing/ActiveRouter.java:140–159  ·  view source on GitHub ↗
(String id, DTNHost from)

Source from the content-addressed store, hash-verified

138 }
139
140 @Override
141 public Message messageTransferred(String id, DTNHost from) {
142 Message m = super.messageTransferred(id, from);
143
144 /**
145 * N.B. With application support the following if-block
146 * becomes obsolete, and the response size should be configured
147 * to zero.
148 */
149 // check if msg was for this host and a response was requested
150 if (m.getTo() == getHost() && m.getResponseSize() > 0) {
151 // generate a response message
152 Message res = new Message(this.getHost(),m.getFrom(),
153 RESPONSE_PREFIX+m.getId(), m.getResponseSize());
154 this.createNewMessage(res);
155 this.getMessage(RESPONSE_PREFIX+m.getId()).setRequest(m);
156 }
157
158 return m;
159 }
160
161 /**
162 * Returns a list of connections this host currently has with other hosts.

Callers

nothing calls this directly

Calls 9

getToMethod · 0.95
getResponseSizeMethod · 0.95
getFromMethod · 0.95
getIdMethod · 0.95
createNewMessageMethod · 0.95
setRequestMethod · 0.80
messageTransferredMethod · 0.65
getHostMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected