If you want your subclass to do anything, youll want to override the init method so that you can set up handlers for specific types of messages from the subsystem client. For each message type, you need to associate the type with a subroutine reference that will be invoked when a message of that type is received by the core server. You do this by calling the register_handler method (see below).
When the core server receives new messages from the client, it grabs the first byte from the incoming stream; the first byte is a packed 8-bit integer representing the type of the message. This identifier is used to look up the message handler to handle this particular type of message.
Make sure that your init method returns the $ss object on success; failure to return init should be an indication of failure to calling code.
The location of a file on disk where you can write messages to be logged. This is the file to which messages sent to the log method (below) will be written.
This is an optional argument; if not specified, no log file will be used, and calls to log will be silently ignored.
The subroutine reference $code will be invoked and given
two arguments: $ss, the instance of the subsystem server
that is blessed into your subclass, and $msg, a buffer in
the class Net::SSH::Perl::Buffer (although you can choose
a different buffer classsee buffer_class, below).
Sends the message $msg to the client. Or, in more technical
terms, adds the message $msg to the servers output queue, to
be written back to the client the next time through the select
$msg should be a buffer in the class Net::SSH::Perl::Buffer
(although you can choose a different buffer classsee
Enters the select loop, waiting for requests from the client.
Users of your class should call this method when theyre
ready to start serving clients.
Writes the log message $message to the log file, if one was
specified as the Log argument to init (or, rather, to the
If a log file was not specified, returns silently.
By default, messages are represented by Net::SSH::Perl::Buffer
objects. You can alter this by overriding the buffer_class
method; it should return the name of an alternate class. Be aware
that this alternate class must conform to the interface used
by Net::SSH::Perl::Buffer, so you may be best off subclassing
that class and adding in your own functionality.
It should be noted that the external interface (API) to this module is alpha, and could change.
Please see the Net::SSH::Perl manpage for author, copyright, and license information.
|perl v5.20.3||NET::SSH::PERL::SUBSYSTEM::SERVER (3)||2015-09-12|