20 #ifndef NETSOCKETMONITOR_H
21 #define NETSOCKETMONITOR_H
26 #include <util/constants.h>
27 #include <ktorrent_export.h>
34 class TrafficShapedSocket;
44 class KTORRENT_EXPORT SocketMonitor
48 virtual ~SocketMonitor();
51 void add(TrafficShapedSocket* sock);
54 void remove(TrafficShapedSocket* sock);
56 typedef std::list<TrafficShapedSocket*>::iterator Itr;
59 Itr begin() {
return sockets.begin();}
62 Itr end() {
return sockets.end();}
71 void signalPacketReady();
92 Uint32 newGroup(GroupType type,Uint32 limit,Uint32 assured_rate);
100 void setGroupLimit(GroupType type,Uint32 gid,Uint32 limit);
108 void setGroupAssuredRate(GroupType type,Uint32 gid,Uint32 as);
115 void removeGroup(GroupType type,Uint32 gid);
117 static void setDownloadCap(Uint32 bytes_per_sec);
118 static Uint32 getDownloadCap();
119 static void setUploadCap(Uint32 bytes_per_sec);
120 static Uint32 getUploadCap();
121 static void setSleepTime(Uint32 sleep_time);
127 std::list<TrafficShapedSocket*> sockets;