Search in sources :

Example 1 with EmptyResponse

use of i2p.bote.packet.EmptyResponse in project i2p.i2p-bote by i2p.

the class I2PSendQueue method packetReceived.

// Implementation of PacketListener
@Override
public void packetReceived(CommunicationPacket packet, Destination sender, long receiveTime) {
    if (packet instanceof ResponsePacket) {
        UniqueId packetId = packet.getPacketId();
        for (PacketBatch batch : runningBatches) if (batch.contains(packetId)) {
            DataPacket payload = ((ResponsePacket) packet).getPayload();
            if (payload != null)
                batch.addResponse(sender, payload);
            else
                batch.addResponse(sender, new EmptyResponse());
        }
    }
}
Also used : UniqueId(i2p.bote.UniqueId) ResponsePacket(i2p.bote.packet.ResponsePacket) DataPacket(i2p.bote.packet.DataPacket) EmptyResponse(i2p.bote.packet.EmptyResponse)

Aggregations

UniqueId (i2p.bote.UniqueId)1 DataPacket (i2p.bote.packet.DataPacket)1 EmptyResponse (i2p.bote.packet.EmptyResponse)1 ResponsePacket (i2p.bote.packet.ResponsePacket)1