#include <delaychan.h>
Inheritance diagram for PDelayChannel:
Construction | |
enum | Mode { DelayReadsOnly, DelayWritesOnly, DelayReadsAndWrites } |
PDelayChannel (Mode mode, unsigned frameDelay, PINDEX frameSize=0, unsigned maximumSlip=250, unsigned minimumDelay=10) | |
Public Types | |
Public Member Functions | |
Overrides from class PChannel | |
virtual BOOL | Read (void *buf, PINDEX len) |
virtual BOOL | Write (const void *buf, PINDEX len) |
Protected Member Functions | |
virtual void | Wait (PINDEX count, PTimeInterval &nextTick) |
Protected Attributes | |
Mode | mode |
unsigned | frameDelay |
PINDEX | frameSize |
PTimeInterval | maximumSlip |
PTimeInterval | minimumDelay |
PTimeInterval | nextReadTick |
PTimeInterval | nextWriteTick |
There are two modes of operation. In stream more, data can be read/written no faster than a fixed time for a fixed number of bytes. So, for example, you can say than 320 bytes must take 20 milliseconds, and thus if the application writes 640 byets it will delay 40 milliseconds before the next write.
In frame mode, the rate limiting applies to individual read or write operations. So you can say that each read takes 30 milliseconds even if on 4 bytes is read, and the same time if 24 bytes are read.
|
|
|
Create a new delay channel with the specified delays. A value of zero for the numBytes parameter indicates that the delay is in frame mode. The maximum skip time is the number of milliseconds that the delay may "catch up" by using zero delays. This is caused by the Read() or Write() not being called for a time by external factors.
|
|
Low level read from the file channel. The read timeout is ignored for file I/O. The GetLastReadCount() function returns the actual number of bytes read. The GetErrorCode() function should be consulted after Read() returns FALSE to determine what caused the failure.
Reimplemented from PIndirectChannel. |
|
|
|
Low level write to the file channel. The write timeout is ignored for file I/O. The GetLastWriteCount() function returns the actual number of bytes written. The GetErrorCode() function should be consulted after Write() returns FALSE to determine what caused the failure.
Reimplemented from PIndirectChannel. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|