libktorrent  2.1.1
Public Member Functions | List of all members
net::SocketGroup Class Reference

#include <socketgroup.h>

Public Member Functions

 SocketGroup (Uint32 limit, Uint32 assured_rate)
 
void add (TrafficShapedSocket *s)
 Add a socket for processing.
 
void calcAllowance (bt::TimeStamp now)
 
void clear ()
 Clear the lists of sockets.
 
bool download (Uint32 &global_allowance, bt::TimeStamp now)
 
Uint32 getAssuredAllowance () const
 
Uint32 numSockets () const
 Get the number of sockets.
 
void setAssuredRate (Uint32 as)
 
void setLimit (Uint32 lim)
 
bool upload (Uint32 &global_allowance, bt::TimeStamp now)
 

Detailed Description

Author
Joris Guisson joris.nosp@m..gui.nosp@m.sson@.nosp@m.gmai.nosp@m.l.com

Definition at line 53 of file socketgroup.h.

Member Function Documentation

◆ calcAllowance()

void net::SocketGroup::calcAllowance ( bt::TimeStamp  now)

Calculate the allowance for this group

Parameters
nowCurrent timestamp

◆ download()

bool net::SocketGroup::download ( Uint32 &  global_allowance,
bt::TimeStamp  now 
)

Process all the sockets in the vector for download.

Parameters
global_allowanceHow much the group can do, this will be updated, 0 means no limit
nowCurrent time
Returns
true if we can download more data, false otherwise

◆ getAssuredAllowance()

Uint32 net::SocketGroup::getAssuredAllowance ( ) const
inline

Get the assured allowance .

Definition at line 111 of file socketgroup.h.

◆ setAssuredRate()

void net::SocketGroup::setAssuredRate ( Uint32  as)
inline

Set the assured rate for the gorup in bytes per sec

Parameters
asThe assured rate

Definition at line 97 of file socketgroup.h.

◆ setLimit()

void net::SocketGroup::setLimit ( Uint32  lim)
inline

Set the group limit in bytes per sec

Parameters
limThe limit

Definition at line 91 of file socketgroup.h.

◆ upload()

bool net::SocketGroup::upload ( Uint32 &  global_allowance,
bt::TimeStamp  now 
)

Process all the sockets in the vector for upload

Parameters
global_allowanceHow much the group can do, this will be updated, 0 means no limit
nowCurrent time
Returns
true if we can upload more data, false otherwise

The documentation for this class was generated from the following file: