22 #ifndef NET_TRAFFICSHAPEDSOCKET_H
23 #define NET_TRAFFICSHAPEDSOCKET_H
26 #include <net/socketdevice.h>
27 #include <util/constants.h>
45 virtual void onDataReady(bt::Uint8* buf, bt::Uint32 size) = 0;
74 virtual Uint32
read(Uint32 max_bytes_to_read, bt::TimeStamp now);
82 virtual Uint32
write(Uint32 max, bt::TimeStamp now) = 0;
123 mutable QMutex mutex;
128 #endif // NET_TRAFFICSHAPEDSOCKET_H
void updateSpeeds(bt::TimeStamp now)
Update up and down speed.
virtual void postProcess(bt::Uint8 *data, bt::Uint32 size)
void setGroupID(Uint32 gid, bool upload)
virtual Uint32 write(Uint32 max, bt::TimeStamp now)=0
virtual Uint32 read(Uint32 max_bytes_to_read, bt::TimeStamp now)
virtual bool bytesReadyToWrite() const =0
See if the socket has something ready to write.
Uint32 downloadGroupID() const
Get the download group ID.
void setReader(SocketReader *r)
Set the reader.
int getDownloadRate() const
Get the current download rate.
virtual void onDataReady(bt::Uint8 *buf, bt::Uint32 size)=0
int getUploadRate() const
Get the current download rate.
Uint32 uploadGroupID() const
Get the upload group ID.
SocketDevice * socketDevice()
Get the SocketDevice.
const SocketDevice * socketDevice() const
Get the SocketDevice (const vesion)