22 #ifndef UTP_LOCALWINDOW_H
23 #define UTP_LOCALWINDOW_H
26 #include <ktorrent_export.h>
27 #include <util/constants.h>
28 #include <QSharedPointer>
29 #include "packetbuffer.h"
36 const bt::Uint32 DEFAULT_CAPACITY = 64*1024;
41 WindowPacket(bt::Uint16 seq_nr, bt::Buffer::Ptr packet, bt::Uint32 data_off);
44 bt::Uint32 read(bt::Uint8* dst, bt::Uint32 max_len);
45 bool fullyRead()
const;
46 void set(bt::Buffer::Ptr packet, bt::Uint32 data_off);
49 bt::Buffer::Ptr packet;
50 bt::Uint32 bytes_read;
82 bool isEmpty()
const {
return incoming_packets.empty();}
85 bt::Uint32
read(bt::Uint8* data, bt::Uint32 max_len);
100 typedef std::vector<WindowPacket> WindowPacketList;
102 bt::Uint16 last_seq_nr;
103 bt::Uint16 first_seq_nr;
105 WindowPacketList incoming_packets;
106 bt::Uint32 window_space;
107 bt::Uint32 bytes_available;
112 #endif // UTP_LOCALWINDOW_H