HttpConn

The HttpConn class provides a simple means for retrieving data through thr HTTP protocol.

Publicly inherits Connection.

Public Methods

HttpConn( const Url& url );
virtual boolopen( );

Public Slots

virtual voidreadable( );
virtual voidwritable( );

Private Methods

voidprocHeader( );

Signals

virtual voiddata( const char* bytes, int length );
virtual voidendOfData( );
virtual voidstartOfData( QString mediaType, QString mediaSubtype, int totalSize );
virtual voidstatus( QString msg );
virtual voidurlChanged( const Url& url );

Private Data Members

QString_header;
QString_location;
QString_mediaSubtype;
QString_mediaType;
int_reqStatus;
QString_reqStatusText;

Public Methods Documentation

HttpConn ( const Url& url );

Create a new HttpConn.

virtual bool open ( );

Open an HTTP connection to a remote host. Look up the host, create a create a socket, send the request, and switch to non-blocking mode.

Public Slots Documentation

virtual void readable ( );

The connection has data to be read. Read it and emit it.

Private Methods Documentation

void procHeader ( );

Process an HTTP header. We are interested in headers that specify the Internet media type, the data size, or the new location of the data.

Signals Documentation

virtual void data ( const char* bytes, int length );

Emit data as it is received.

virtual void endOfData ( );

Emit notification that the connection has been torn down.

virtual void startOfData ( QString mediaType, QString mediaSubtype, int totalSize );

Emit the Internet media type and size of the data stream.

virtual void status ( QString msg );

Emit message about connection status and data transfered.

virtual void urlChanged ( const Url& url );

This signal is emitted when the URL being retrieved changes because of an HTTP redirect.


Return to Index.
Automatically generated on Aug 11 23:32