ARCv2
view release on metacpan or search on metacpan
lib/Arc/Connection.pod view on Meta::CPAN
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 _CommandConnection ( )
B<Description>: initializes command connection. (protocol)
Starts listen on the Command socket and sends the B<CMDPASV> command.
B<Returns:> true if everything went like expected, otherwise false.
B<Example:>
$this->_CommandConnection();
=item _Init ( ) I<reimplemented from Arc>
=item _PrepareAuthentication ( )
B<Description>: initialize sasl.
This function initializes the C<__sasl> member with an object
of C<Authen::SASL>.
B<Returns:> true if successful, otherwise false
B<Example:>
$this->_PrepareAuthentication() || return;
=item _ProcessLine ( $cmd )
B<Description>: process an ARCv2 command. (protocol)
Process a command by evaling $this->_R$cmd. Also checks if
this command was expected now (looks into the $this->{_expectedcmds} array).
Used by client and server.
B<Returns:> true, if ARCv2 command has been in place, otherwise false
B<Example:>
while (my $cmd = $this->_RecvCommand() && $this->_ProcessLine($cmd)) {}
=item _ReadWriteBinary ( *locfdin, *locfdout )
B<Description>: function for reading and writing on the command connection.
This function is always used by the C<Arc::Connection::Server> to handle
command data. When calling the C<ProcessCommand> from C<Arc::Connection::Client>
this function is also used.
Data is read from the local socket resp. pipe and is written encrypted
to the network socket. The other side reads the data from network socket,
decrypts it and writes it to its local socket. This function behaves differently on
client and server sides, when the local or network socket is closed.
B<Returns:> always true
B<Example:>
$this->ReadWriteBinary(*STDIN,*STDOUT);
=item _RecvCommand ( )
B<Description>: receives an ARCv2 Command. (protocol)
This function gets a line from C<_RecvLine> and extracts the ARCv2 command and
the optional command parameter C<_cmdparameter>.
B<Returns:> ARCv2 command and true if everything works fine, otherwise false
B<Example:>
while (my $cmd = $this->_RecvCommand()) { ... }
=item _RecvLine ( )
B<Description>: receive a line (command). (protocol)
This function receives data from the ARCv2 connection and
fills the internal C<__linequeue> and C<__partial>. It returns
a line from the internal buffer if there is any. It also handles
timeouts and "connection closed by foreign host"'s.
B<Returns:> true (and the line) if everything worked fine, otherwise false (undef)
( run in 0.599 second using v1.01-cache-2.11-cpan-39bf76dae61 )