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)
| 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 |
no test coverage detected