Query: io::async::protocol::linestream
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
IO::Async::Protocol::LineStream(3pm) User Contributed Perl Documentation IO::Async::Protocol::LineStream(3pm)NAME"IO::Async::Protocol::LineStream" - stream-based protocols using lines of textSYNOPSISMost 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.DESCRIPTIONEVENTSThe 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.PARAMETERSThe 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.AUTHORPaul Evans <leonerd@leonerd.org.uk> perl v5.14.2 2012-10-24 IO::Async::Protocol::LineStream(3pm)
Related Man Pages |
---|
io::async::detachedcode(3pm) - debian |
io::async::file(3pm) - debian |
io::async::handle(3pm) - debian |
io::async::pid(3pm) - debian |
io::async::timer(3pm) - debian |
Similar Topics in the Unix Linux Community |
---|
paging a text file line by line? |
Async or Sync I/O on NFS ? |
ZRTP Protocol Library 1.1.0 (Default branch) |
Split the file based on the content |
How to insert new line in perl |