QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Net::ReadStream Struct Reference
[QNet]

#include <Q/net.h>

Inheritance diagram for Net::ReadStream:

Net::StreamBase Com::Unknown List of all members.

Public Types

typedef Com::Ptr< ReadStreamPTR
enum  Status {
  Success = 0,
  Failure = 1,
  WouldBlock = 2
}

Public Member Functions

virtual bool read (void *buf, size_t bytes, size_t &bytesRead, bool wait)=0
virtual void setReader (ReadListener *rl)=0

Static Public Attributes

Com::UUID IID

Detailed Description

Data read from a network resource is accessed using a ReadStream object. Metadata associated with the stream (e.g. header values from an HTTP request) is represented as named attributes with values that can be accessed either as strings or as integers from an associated MediaObject.


Member Function Documentation

virtual bool Net::ReadStream::read void *  buf,
size_t  bytes,
size_t &  bytesRead,
bool  wait
[pure virtual]
 

Read a number of characters from the stream. The number of characters read will be returned in the 'bytesRead' argument. If end-of-file is detected on the stream, 'bytesRead' will be set to zero. If the argument 'wait' is true and there is no data immediately avalable, the method will wait until data arrives.

This method will return true if data (or an end-of-file marker) was read or false if no data was readable in the non-blocking case.

virtual void Net::ReadStream::setReader ReadListener rl  )  [pure virtual]
 

Start monitoring a stream for incoming data. When data is available to be read, the onReadable() method of the listener will be called. Applications should create a derived class of ReadListener which implements this method. To cancel a listener previously registered with setReader(), simply call setReader() with a null argument.


Member Data Documentation

Com::UUID Net::ReadStream::IID [static]
 

COM IID 3423fc32-bf7d-4086-893d-9fb34ae96582

Reimplemented from Net::StreamBase.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004