IO::Async::Protocol::LineStream man page on Alpinelinux

Man page or keyword search:  
man Server   18016 pages
apropos Keyword Search (all sections)
Output format
Alpinelinux logo
[printable version]

IO::Async::Protocol::LUsertContributed Perl IO::Async::Protocol::LineStream(3)

NAME
       "IO::Async::Protocol::LineStream" - stream-based protocols using lines
       of text

SYNOPSIS
       Most likely this class will be subclassed to implement a particular
       network protocol.

	package Net::Async::HelloWorld;

	use strict;
	use warnings;
	use base qw( IO::Async::Protocol::LineStream );

	sub on_read_line
	{
	   my $self = shift;
	   my ( $line ) = @_;

	   if( $line =~ m/^HELLO (.*)/ ) {
	      my $name = $1;

	      $self->invoke_event( on_hello => $name );
	   }
	}

	sub send_hello
	{
	   my $self = shift;
	   my ( $name ) = @_;

	   $self->write_line( "HELLO $name" );
	}

       This small example elides such details as error handling, which a real
       protocol implementation would be likely to contain.

DESCRIPTION
EVENTS
       The following events are invoked, either using subclass methods or CODE
       references in parameters:

   on_read_line $line
       Invoked when a new complete line of input is received.

PARAMETERS
       The following named parameters may be passed to "new" or "configure":

       on_read_line => CODE
	       CODE reference for the "on_read_line" event.

METHODS
   $lineprotocol->write_line( $text )
       Writes a line of text to the transport stream. The text will have the
       end-of-line marker appended to it; $text should not end with it.

AUTHOR
       Paul Evans <leonerd@leonerd.org.uk>

perl v5.18.2			  2014-05-14IO::Async::Protocol::LineStream(3)
[top]

List of man pages available for Alpinelinux

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net