The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::Msmgr::Command

SYNOPSIS

 use Net::Msmgr::Command;

 my $connection = new Net::Msmgr::Connection( .... );

 my $command = new Net::Msmgr::Command;

 $command->type(Net::Msmgr::Command::Async); # there are other types
 $command->cmd('XYZ');          # one of the MSNP messages
 $command->params( [ param1, param2, ... ] );

 $command->send($connection);

DESCRIPTION

Net::Msmgr::Command is the encapsulation for an MSNP command. They come in four types, and this library provides manifest constants for each type.

Net::Msmgr::Command::Normal

This is a normal command. It will have a TRID and no payload.

Net::Msmgr::Command::Async

This is used to instantiate async commands, which are commands that have no TRID.

Net::Msmgr::Command::Payload

These are commands with payload data (e.g. MSG), and a TRID.

Net::Msmgr::Command::Pseudo

These are unused in the current version of the library, but are placeholders to associate with user handlers.

CONSTRUCTOR

 my $command = new Net::Msmgr::Command ( type => ... );

 or

 my $command = Net::Msmgr::Command->new( type => ...);

 Constructor parameters are:
type (mandatory)

One of Net::Msmgr::Command::Async, Payload, Normal, or Pseudo

cmd (mandatory)

A MSNP Command (e.g. MSG, USR, XFR)

params (optional)

A listref of optional parameters. Each command type has a fixed list of parameters.

body (optional)

The payload data for Net::Msmgr::Command::Payload messages.

INSTANCE METHODS

    $command->as_text;

    Human readable representation of only the command and parameters (excluding payload data) for debugging.

    $command->send( $connection );

    Associate a command with a Net::Msmgr::Connection stream and transmit it.

ACCESSOR METHODS

my $type = $command->type;
$command->type($newtype);

Read or set the type.

my $cmd = $command->cmd; =item $command->cmd($newcmd);

Read or set the cmd.

my @params = @{$command->params};
$command->params( [ $p0, $p1, $p2 ] );

Read or set the parameter list.

my $connection = $command->connection;
$command->connection($new_connection);

Set or change the connection stream associated with this command. Probably not a good idea.

my $body = $command->body;
$command->body($new_body);

Read or set the body.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 99:

You can't have =items (as at line 116) unless the first thing after the =over is an =item

Around line 191:

=over without closing =back