#include <networkthread.h>
|
|
| NetworkThread (SocketMonitor *sm) |
| |
| void | addGroup (Uint32 gid, Uint32 limit, Uint32 assured_rate) |
| |
| virtual bool | doGroup (SocketGroup *g, Uint32 &allowance, bt::TimeStamp now)=0 |
| |
|
bool | isRunning () const |
| | Is the thread running.
|
| |
| void | removeGroup (Uint32 gid) |
| |
| void | run () override |
| |
| void | setGroupAssuredRate (Uint32 gid, Uint32 as) |
| |
| void | setGroupLimit (Uint32 gid, Uint32 limit) |
| |
|
void | stop () |
| | Stop before the next update.
|
| |
| virtual void | update ()=0 |
| |
|
int | add (int fd, Mode mode) |
| | Add a file descriptor to the poll (returns the index of it)
|
| |
|
int | add (PollClient::Ptr pc) |
| | Add a poll client.
|
| |
|
int | poll (int timeout=-1) |
| | Poll all sockets.
|
| |
|
bool | ready (int index, Mode mode) const |
| | Check if a socket at an index is read.
|
| |
|
void | reset () |
| | Reset the poll.
|
| |
|
| void | doGroups (Uint32 num_ready, bt::TimeStamp now, bt::Uint32 limit) |
| |
|
| enum | Mode { INPUT,
OUTPUT
} |
| |
- Author
- Joris Guisson joris.nosp@m..gui.nosp@m.sson@.nosp@m.gmai.nosp@m.l.com
Base class for the 2 networking threads. Handles the socket groups.
Definition at line 40 of file networkthread.h.
◆ addGroup()
| void net::NetworkThread::addGroup |
( |
Uint32 |
gid, |
|
|
Uint32 |
limit, |
|
|
Uint32 |
assured_rate |
|
) |
| |
Add a new group with a given limit
- Parameters
-
| gid | The group ID (cannot be 0, 0 is the default group) |
| limit | The limit in bytes per sec |
| assured_rate | The assured rate for this group in bytes per second |
◆ doGroup()
| virtual bool net::NetworkThread::doGroup |
( |
SocketGroup * |
g, |
|
|
Uint32 & |
allowance, |
|
|
bt::TimeStamp |
now |
|
) |
| |
|
pure virtual |
Do one SocketGroup
- Parameters
-
| g | The group |
| allowance | The groups allowance |
| now | The current time |
- Returns
- true if the group can go again
◆ doGroups()
| void net::NetworkThread::doGroups |
( |
Uint32 |
num_ready, |
|
|
bt::TimeStamp |
now, |
|
|
bt::Uint32 |
limit |
|
) |
| |
|
protected |
Go over all groups and do them
- Parameters
-
| num_ready | The number of ready sockets |
| now | The current time |
| limit | The global limit in bytes per sec |
◆ removeGroup()
| void net::NetworkThread::removeGroup |
( |
Uint32 |
gid | ) |
|
Remove a group
- Parameters
-
◆ run()
| void net::NetworkThread::run |
( |
| ) |
|
|
override |
The main function of the thread
◆ setGroupAssuredRate()
| void net::NetworkThread::setGroupAssuredRate |
( |
Uint32 |
gid, |
|
|
Uint32 |
as |
|
) |
| |
Set the assured rate for a group
- Parameters
-
| gid | The group ID |
| as | The assured rate |
◆ setGroupLimit()
| void net::NetworkThread::setGroupLimit |
( |
Uint32 |
gid, |
|
|
Uint32 |
limit |
|
) |
| |
Set the limit for a group
- Parameters
-
| gid | The group ID |
| limit | The limit |
◆ update()
| virtual void net::NetworkThread::update |
( |
| ) |
|
|
pure virtual |
Subclasses must implement this function
The documentation for this class was generated from the following file: