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

Method receiveMessage

routing/MessageRouter.java:319–330  ·  view source on GitHub ↗

Try to start receiving a message from another host. @param m Message to put in the receiving buffer @param from Who the message is from @return Value zero if the node accepted the message (RCV_OK), value less than zero if node rejected the message (e.g. DENIED_OLD), value bigger than zero if the oth

(Message m, DTNHost from)

Source from the content-addressed store, hash-verified

317 * than zero if the other node should try later (e.g. TRY_LATER_BUSY).
318 */
319 public int receiveMessage(Message m, DTNHost from) {
320 Message newMessage = m.replicate();
321
322 this.putToIncomingBuffer(newMessage, from);
323 newMessage.addNodeOnPath(this.host);
324
325 for (MessageListener ml : this.mListeners) {
326 ml.messageTransferStarted(newMessage, from, getHost());
327 }
328
329 return RCV_OK; // superclass always accepts messages
330 }
331
332 /**
333 * This method should be called (on the receiving host) after a message

Callers 1

sendMessageMethod · 0.45

Calls 5

putToIncomingBufferMethod · 0.95
addNodeOnPathMethod · 0.95
getHostMethod · 0.95
replicateMethod · 0.45

Tested by

no test coverage detected