public DataStructure createDataStructure() throws DataFormatException { ReceiveMessageEndMessage msg = new ReceiveMessageEndMessage(); msg.setSessionId(321); msg.setMessageId(123); return msg; } public DataStructure createStructureToRead() { return new ReceiveMessageEndMessage(); }
/** * The client told us that the message has been received completely. This currently * does not do any security checking prior to removing the message from the * pending queue, though it should. * */ private void handleReceiveEnd(ReceiveMessageEndMessage message) { _runner.removePayload(new MessageId(message.getMessageId())); }
public DataStructure createStructureToRead() { return new ReceiveMessageEndMessage(); } }
return new ReceiveMessageBeginMessage(); case ReceiveMessageEndMessage.MESSAGE_TYPE: return new ReceiveMessageEndMessage(); case ReconfigureSessionMessage.MESSAGE_TYPE: return new ReconfigureSessionMessage();
public void handleMessage(I2CPMessage message, I2PSessionImpl session) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Handle message " + message + " for session " + session); try { MessagePayloadMessage msg = (MessagePayloadMessage) message; long id = msg.getMessageId(); decryptPayload(msg, session); session.addNewMessage(msg); // Small chance of this, but // if we are a new I2P lib talking to an old router // and we don't send this, the router will OOM as it has // no cleaner for old messages. // Check router version from handshake // and send it all the time if 0.9.3 or less // (needs router version saving support in SetDateMessageHandler) if (!session.getFastReceive()) { ReceiveMessageEndMessage m = new ReceiveMessageEndMessage(); m.setMessageId(id); m.setSessionId(msg.getSessionId()); session.sendMessage(m); } } catch (DataFormatException dfe) { session.propogateError("Error handling a new payload message", dfe); } catch (I2PSessionException ise) { session.propogateError("Error handling a new payload message", ise); } }