Search in sources :

Example 1 with ReceiveMessageEndMessage

use of net.i2p.data.i2cp.ReceiveMessageEndMessage in project i2p.i2p by i2p.

the class MessagePayloadMessageHandler method handleMessage.

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);
        // (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);
    }
}
Also used : MessagePayloadMessage(net.i2p.data.i2cp.MessagePayloadMessage) DataFormatException(net.i2p.data.DataFormatException) ReceiveMessageEndMessage(net.i2p.data.i2cp.ReceiveMessageEndMessage) I2PSessionException(net.i2p.client.I2PSessionException)

Aggregations

I2PSessionException (net.i2p.client.I2PSessionException)1 DataFormatException (net.i2p.data.DataFormatException)1 MessagePayloadMessage (net.i2p.data.i2cp.MessagePayloadMessage)1 ReceiveMessageEndMessage (net.i2p.data.i2cp.ReceiveMessageEndMessage)1