(String id, DTNHost from)
| 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. |
nothing calls this directly
no test coverage detected