W3C libwww Using

The Access Manager

At this point most of the design issues have been addressed and the Library it is now possible to use the Library to exchange information between the application an the Internet. The Library provides a set of functions that can be used to request a URI either on a remote server or on the local file system. The access method binds the URL with a specific protocol module as described in section Access Methods and the stream chains defines the data flow for incoming and outgoing data.

Searching a URL


Receiving an Entity


Sending an Entity


Return Codes from the Access manager

The access manager has a standard set of return codes that the application can use for diagnostics. They should only be used as indications of the result as a more detailed description of any error situation is registered in the error handler. The set of codes are:

A generic success code that indicates that the request has been fulfilled
Partly a success code, but no document has been retrieved and a client application is encouraged to maintain the previous document view as the current view. A HT_NO_DATA code might be the result when a telnet session is started etc.
An error has occured and the request could not be fulfilled
The remote server is temporarily unavailable and no more requests should be issued to the server before the calendar time indicated in HTRequest->retry_after field. No action is taken by the Library to automatically retry the request, this is uniquely for the application to decide.
An I/O operation would block and the request must pause. As the request is not yet terminated, the operation will continue at a later time when the blocking situation has ceased to exist.

Context Swapping

In a multithreaded environment it is necessary to keep track of the context of each simultanous requests issued to the Library as the response might return in another order than the one they were issued. The Library allows such a context registration in the HTRequest object by providing the registration mechanism of a call back function and a pointer to an arbitrary data object to be passed to that call back function.

Henrik Frystyk, libwww@w3.org, @(#) $Id: Access.html,v 1.13 1997/02/16 18:41:41 frystyk Exp $