
Net::xAP - An interface to the protocol beneath IMAP, ACAP, and ICAP.
WARNING: This code is in alpha release. Expect the interface to change.

use Net::xAP;

This base class implements the protocol that is common across the IMAP, ACAP, ICAP protocols. It provides the majority of the interface to the network calls and implements a small amount of glue to assist in implementing interfaces to this protocol family.


Create a new instance of Net::xAP and returns a reference to the object.
The $host parameter is the name of the host to contact.
The $peerport parameter is the tcp port to connect to.
The parameter should be in the syntax understood by IO::Socket::INET->new).
%options specifies any options to use.
Currently,
the only option that Net::xAP uses is Debug.
All of the options are passed to a call to IO::Socket::INET->new.
The command is used to send commands to the connected server and to setup callbacks for subsequent use by the response method.
The $callback parameter should be a reference to a subroutine that will be called when input is received.
This callback is responsible for processing any of the responses from the server that pertain the given command.
@args is a list of $type-$value pairs.
The $type says what type of data type to use for $value.
The mechanism is used to control the encoding necessary to pass the command arguments to the server.
The following $types are understood:
The data will sent raw to the server.
The data will be sent to the server as an atom,
a quoted string,
or a literal depending on the content of $value.
The data in $value will be interpreted as an array reference and be sent inside a pair of parentheses.
The data will be sent to the server as either a quoted string or literal depending on the content of $value.
Gets one line of data from the server,
parses it into a list of fields and returns a reference to the list.
getline uses the parse_line method to do the parsing.
Return what time the most recent command was sent to the server.
It returns value as a time integer.
Returns the connection object being used by the object.
Returns the sequence number of the last command issued to the server.
Returns the sequence number that will be assigned to the next command issued.
Returns a list of sequence numbers for the commands that are still awaiting a complete response from the server.
This will also include any recent commands issued without corresponding response methods called.
NEEDS TO BE REWORDED
The list is sorted numerically.
Returns the value of the debug flag for the object.
If $boolean is specified,
set the debug state to the given value.
A stub method intended to be overridden by subclasses.
It is intended to provide subclasses to make alterations to $text for use by the debug_print method.
The base-class version does no alteration of $text.
Prints $text to STDERR.
The parameter $direction is used to notate what direction the call is interested in - 0 for data being sent to the server,
1 for data coming from the server.
This mechanism might change in the future...

A response object is the data type returned by the response method.
A few convenience routines are provided at the Net::xAP level that are likely to be common across several protocols.
Returns the tag associated with the response object.
Returns the command status associated with the response object.
This will be OK,
NO,
or BAD.
Returns the human readable text assocated with the status of the response object.
This will typically be overridden by a subclass of the xAP class to handle things like status codes.

With only a few exceptions, the methods provided in this class are not intended to be used by end-programmers. They are intended to be used by implementers of protocols that use the class.

Kevin Johnson <kjj@pobox.com>

Copyright (c) 1997 Kevin Johnson <kjj@pobox.com>.
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.