public DataStructure createDataStructure() throws DataFormatException { DestReplyMessage msg = new DestReplyMessage(); return msg; } public DataStructure createStructureToRead() { return new DestReplyMessage(); }
public void handleMessage(I2CPMessage message, I2PSessionImpl session) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Handle message " + message); DestReplyMessage msg = (DestReplyMessage) message; Destination d = msg.getDestination(); if (d != null) { session.destReceived(d); } else { Hash h = msg.getHash(); if (h != null) session.destLookupFailed(h); } // else let it time out } }
public DataStructure createStructureToRead() { return new DestReplyMessage(); } }
private void returnDest(Destination d) { I2CPMessage msg; if (_reqID >= 0) msg = new HostReplyMessage(_sessID, d, _reqID); else msg = new DestReplyMessage(d); try { _runner.doSend(msg); } catch (I2CPMessageException ime) {} }
/** * Return the failed hash so the client can correlate replies with requests * @since 0.8.3 */ private void returnFail() { I2CPMessage msg; if (_reqID >= 0) msg = new HostReplyMessage(_sessID, HostReplyMessage.RESULT_FAILURE, _reqID); else msg = new DestReplyMessage(_hash); try { _runner.doSend(msg); } catch (I2CPMessageException ime) {} } }
/** * Look only in current local dests */ @Override protected void handleDestLookup(DestLookupMessage message) { Hash h = message.getHash(); DestReplyMessage msg; Destination d = ((LocalClientConnectionRunner)_runner).localLookup(h); if (d != null) msg = new DestReplyMessage(d); else msg = new DestReplyMessage(h); try { _runner.doSend(msg); } catch (I2CPMessageException ime) { ime.printStackTrace(); } }
return new DestLookupMessage(); case DestReplyMessage.MESSAGE_TYPE: return new DestReplyMessage(); case GetBandwidthLimitsMessage.MESSAGE_TYPE: return new GetBandwidthLimitsMessage();