|
|
This class is a traffic shaper.
|
Constructor.
|
Constructor.
~ |
Destructor.
void |
Initialize.
Parameters:
socket | Socket. |
inline void |
Set socket to send shaped traffic to.
Parameters:
socket | Socket. |
inline card64 |
[const]
Get bandwidth for following packets.
Returns: Bandwidth.
inline void |
Set bandwidth for following packets.
Parameters:
bandwidth | Bandwidth. |
inline double |
[const]
Get maximum buffer delay for following packets.
Returns: Maximum buffer delay in microseconds.
inline void |
Set maximum buffer delay for following packets.
Parameters:
bufferDelay | Maximum buffer delay in microseconds. |
void |
Flush buffer.
bool |
Adapt buffer's contents to changed bandwidth and delay settings.
Parameters:
trafficClass | Traffic class to remap packets to. |
doRemapping | true, to do traffic class remapping; false otherwise. |
Returns: true, if buffer flush has been necessary; false otherwise.
inline cardinal |
[const]
Get sequence number of last packet sent.
Returns: Sequence number.
ssize_t |
Wrapper for sendto(). sendto() will set the packet's traffic class, if trafficClass is not 0.
Parameters:
buffer | Buffer with data to send. |
length | Length of data to send. |
seqNum | Packet's sequence number (-1 for none). |
flags | Flags for sendto(). |
receiver | Address of receiver. |
Returns: Bytes sent or error code < 0.
ssize_t |
Wrapper for send(). send() will set the packet's traffic class, if trafficClass is not 0. In this case, the packet will be sent by sendto() to the destination address, the socket is connected to!
Parameters:
buffer | Buffer with data to send. |
length | Length of data to send. |
seqNum | Packet's sequence number (-1 for none). |
flags | Flags for sendto(). |
trafficClass | Traffic class for packet. |
Returns: Bytes sent or error code < 0.
ssize_t |
Wrapper for write().
Parameters:
buffer | Buffer with data to write |
length | Length of data to write |
seqNum | Packet's sequence number (-1 for none). |
Returns: Bytes sent or error code < 0.