kget
net::SocketMonitor Class Reference
#include <socketmonitor.h>
Detailed Description
Monitors all sockets for upload and download traffic. It uses two threads to do this.
Definition at line 44 of file socketmonitor.h.
Public Types | |
| enum | GroupType { UPLOAD_GROUP, DOWNLOAD_GROUP } |
| typedef std::list < BufferedSocket * >::iterator | Itr |
Public Member Functions | |
| void | add (BufferedSocket *sock) |
| Itr | begin () |
| Itr | end () |
| void | lock () |
| Uint32 | newGroup (GroupType type, Uint32 limit, Uint32 assured_rate) |
| void | remove (BufferedSocket *sock) |
| void | removeGroup (GroupType type, Uint32 gid) |
| void | setGroupAssuredRate (GroupType type, Uint32 gid, Uint32 as) |
| void | setGroupLimit (GroupType type, Uint32 gid, Uint32 limit) |
| void | signalPacketReady () |
| void | unlock () |
| virtual | ~SocketMonitor () |
Static Public Member Functions | |
| static SocketMonitor & | instance () |
| static void | setDownloadCap (Uint32 bytes_per_sec) |
| static void | setSleepTime (Uint32 sleep_time) |
| static void | setUploadCap (Uint32 bytes_per_sec) |
Member Typedef Documentation
| typedef std::list<BufferedSocket*>::iterator net::SocketMonitor::Itr |
Definition at line 64 of file socketmonitor.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
| net::SocketMonitor::~SocketMonitor | ( | ) | [virtual] |
Definition at line 43 of file socketmonitor.cpp.
Member Function Documentation
| void net::SocketMonitor::add | ( | BufferedSocket * | sock | ) |
Add a new socket, will start the threads if necessary.
Definition at line 97 of file socketmonitor.cpp.
| Itr net::SocketMonitor::begin | ( | ) | [inline] |
| Itr net::SocketMonitor::end | ( | ) | [inline] |
| static SocketMonitor& net::SocketMonitor::instance | ( | ) | [inline, static] |
Definition at line 123 of file socketmonitor.h.
| void net::SocketMonitor::lock | ( | ) |
| Uint32 net::SocketMonitor::newGroup | ( | GroupType | type, | |
| Uint32 | limit, | |||
| Uint32 | assured_rate | |||
| ) |
Creata a new upload or download group.
- Parameters:
-
type Whether it is an upload or download group limit Limit of group in bytes/s assured_rate The assured rate in bytes/s
- Returns:
- The group ID
Definition at line 141 of file socketmonitor.cpp.
| void net::SocketMonitor::remove | ( | BufferedSocket * | sock | ) |
Remove a socket, will stop threads if no more sockets are left.
Definition at line 115 of file socketmonitor.cpp.
| void net::SocketMonitor::removeGroup | ( | GroupType | type, | |
| Uint32 | gid | |||
| ) |
Remove a group.
- Parameters:
-
type The group type gid The group id
Definition at line 173 of file socketmonitor.cpp.
| void net::SocketMonitor::setDownloadCap | ( | Uint32 | bytes_per_sec | ) | [static] |
Definition at line 81 of file socketmonitor.cpp.
| void net::SocketMonitor::setGroupAssuredRate | ( | GroupType | type, | |
| Uint32 | gid, | |||
| Uint32 | as | |||
| ) |
Change the group assured rate.
- Parameters:
-
type The group type gid The group id limit The limit
Definition at line 163 of file socketmonitor.cpp.
| void net::SocketMonitor::setGroupLimit | ( | GroupType | type, | |
| Uint32 | gid, | |||
| Uint32 | limit | |||
| ) |
Change the group limit.
- Parameters:
-
type The group type gid The group id limit The limit
Definition at line 153 of file socketmonitor.cpp.
| void net::SocketMonitor::setSleepTime | ( | Uint32 | sleep_time | ) | [static] |
Definition at line 91 of file socketmonitor.cpp.
| void net::SocketMonitor::setUploadCap | ( | Uint32 | bytes_per_sec | ) | [static] |
Definition at line 86 of file socketmonitor.cpp.
| void net::SocketMonitor::signalPacketReady | ( | ) |
| void net::SocketMonitor::unlock | ( | ) |
The documentation for this class was generated from the following files:
KDE 4.2 API Reference