ARCv2
view release on metacpan or search on metacpan
lib/Arc/Connection/Client.pod view on Meta::CPAN
B<Description>: start an ARCv2 command
This function starts the given ARCv2 Command and enables the Command* functions.
B<Returns:> true if successful, false if not. (IsError is set appropriatly)
B<Example:>
if ($arc->CommandStart()) { ... }
=item CommandWrite ( ... (data) )
B<Description>: write something to the command.
Write something to the standard input of the command started by C<CommandStart>.
B<Returns:> true if successful, false if not. (IsError is set appropriatly)
B<Example:>
last unless $this->CommandWrite();
=item ProcessCommand ( ... (command and its parameters) )
B<Description>: process a command.
This function runs a command with STDIN and STDOUT as clients
in- and output control.
B<Returns:> true if successful, false if not. (IsError is set appropriatly)
B<Example:>
$arc->ProcessCommand("whoami");
=item Quit ( )
B<Description>: ends the connection.
Tells the server that we want to end the conversation. (Userlevel)
Protocol command: QUIT\r\n
B<Returns:> always true
B<Example:>
$arc->Quit();
=item StartSession ( )
B<Description>: start an ARCv2 session.
This function which will change the status of the connection into a
authenticated status. Users have to call this function
to be able to run ARCv2 commands afterwards.
B<Returns:> true if authentication was successful, otherwise false.
B<Example:>
if ($arc->StartSession()) { .. }
=back
=over 2
=item clean ( ) I<inherited from Arc::Connection>
=item IsConnected ( ) I<inherited from Arc::Connection>
B<Description>: are we connected?
B<Returns:> true, if the ARCv2 control connection is connected, otherwise false
B<Example:>
last unless $arc->IsConnected;
=back
=over 2
=item DESTROY ( ) I<inherited from Arc>
B<Description>: Destructor
=item IsError ( ) I<inherited from Arc>
B<Description>: User function to get the error msg.
B<Returns:> the error message if any otherwise undef
B<Example:>
unless (my $err = $arc->IsError()) { .. } else { print STDERR $err; }
=item Log ( $facility, ... (message) ) I<inherited from Arc>
B<Description>: Log function.
Logs messages to 'logdestination' if 'loglevel' is is set appropriatly.
loglevel behaviour has changed in the 1.0 release of ARCv2, the "Arc"-class can export
LOG_AUTH (authentication information), LOG_USER (connection information), LOG_ERR (errors),
LOG_CMD (ARCv2 addition internal command information), LOG_SIDE (verbose client/server-specific
information), LOG_DEBUG (verbose debug information). It possible to combine the
levels with or (resp. +) to allow a message to appear when not all loglevels are
requested by the user.
Commonly used for logging errors from application level.
B<Returns:> always false
B<Example:>
return $arc->Log(LOG_ERR,"Message");
=item new ( %hash, key => val, ... ) I<inherited from Arc>
B<Description>: Constructor.
Initializes the object and returns it blessed.
For all sub classes, please override C<_Init> to check the
parameter which are passed to the C<new> function. This
is necessary because you are not able to call the the new method of a
parent class, when having a class name (new $class::SUPER::new, does not work.).
B<Returns:> blessed object of the class
B<Example:>
my $this = new Arc::Class ( key => value, key2 => value2 );
=back
=over 2
=back
=head3 PROTECTED METHODS
=over 2
=item _Authenticate ( )
B<Description>: initiate the authentication.
Tells the server which authtype we want to use.
Protocol command: AUTHENTICATE [<authtype>]\r\n
B<Returns:> true when succesful, otherwise false
B<Example:>
$this->_Authenticate();
=item _Cmd ( ... (cmd and parameter) )
( run in 0.494 second using v1.01-cache-2.11-cpan-f56aa216473 )