• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kget

net::SocketMonitor

net::SocketMonitor Class Reference

#include <socketmonitor.h>

List of all members.


Detailed Description

Author:
Joris Guisson <joris.guisson@gmail.com>

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

enum net::SocketMonitor::GroupType

Enumerator:
UPLOAD_GROUP 
DOWNLOAD_GROUP 

Definition at line 81 of file socketmonitor.h.


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]

Get the begin of the list of sockets.

Definition at line 67 of file socketmonitor.h.

Itr net::SocketMonitor::end (  )  [inline]

Get the end of the list of sockets.

Definition at line 70 of file socketmonitor.h.

static SocketMonitor& net::SocketMonitor::instance (  )  [inline, static]

Definition at line 123 of file socketmonitor.h.

void net::SocketMonitor::lock (  ) 

lock the monitor

Definition at line 71 of file socketmonitor.cpp.

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 (  ) 

Tell upload thread a packet is ready.

Definition at line 135 of file socketmonitor.cpp.

void net::SocketMonitor::unlock (  ) 

unlock the monitor

Definition at line 76 of file socketmonitor.cpp.


The documentation for this class was generated from the following files:
  • socketmonitor.h
  • socketmonitor.cpp

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal