Protocol class
This class is based on Protocol.pm <http://www.linpro.no/lwp/libwww-perl/lib/LWP/Protocol.pm> from the libwww-perl collection <http://www.linpro.no/lwp/>. (description grabbed from LWP docs)
This class is used a the base class for all protocol implementations.
When creating an instance of this class, using Protocol::create($scheme, $ua), you get an initialised subclass appropriate for that access method. In other words, the Protocol::create() function calls the constructor for one of its subclasses.
All derived Protocol classes need to override the request() method which is used to service a request. The overridden method can make use of the collect() function to collect together chunks of data as it is received.
TODO:
Located in Program_Root/Protocol/Protocol.php (line 61)
| Class | Description |
|---|---|
| Protocol_HTTP_Base | HTTP base class |
| Protocol_NOGO | NOGO class |
Constructor
User Agent object (passed by reference)
Collect.
Called to collect the content of a response, and process it appropriately into a scalar, file, or by calling a callback. If $arg is null, then the content is stored within the $response. If $arg is an instance of File, then the content is written to this file. If $arg is an instance of Callback (or a subclass), then content is passed to the call() method of the object.
The $collector is either:
Note: We will only use the callback or file argument if $response->is_success(). This avoids sendig content data for redirects and authentization responses to the callback which would be confusing.
(passed by reference)
Create.
Create an instance of the class implementing the protocol to handle the given scheme. This is the function user agents should use to access protocols.
Implementor get/set
(optional, use to set class against scheme)
Set error number
new value
Set error string
new value
Documention generated on Wed, 16 Jul 2003 01:03:43 +0100 by phpDocumentor 1.2.0