=encoding utf8 =head1 NAME IOMux::Handler::Read - any mux reader =head1 INHERITANCE IOMux::Handler::Read is an IOMux::Handler IOMux::Handler::Read is extended by IOMux::Bundle IOMux::File::Read IOMux::Net::TCP IOMux::Pipe::Read =head1 SYNOPSIS # only use extensions =head1 DESCRIPTION This base-class defines the interface which every reader offers. Extends L<"DESCRIPTION" in IOMux::Handler|IOMux::Handler/"DESCRIPTION">. =head1 METHODS Extends L<"METHODS" in IOMux::Handler|IOMux::Handler/"METHODS">. =head2 Constructors Extends L<"Constructors" in IOMux::Handler|IOMux::Handler/"Constructors">. =over 4 =item IOMux::Handler::Read-EB(%options) -Option --Defined in --Default fh IOMux::Handler name IOMux::Handler read_size 32768 =over 2 =item fh => FILEHANDLE =item name => STRING =item read_size => INTEGER =back =item IOMux::Handler::Read-EB($mode, $what, %options) Inherited, see L =back =head2 Accessors Extends L<"Accessors" in IOMux::Handler|IOMux::Handler/"Accessors">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$integer] ) The number of bytes requested at each read. =item $obj-EB() Inherited, see L =back =head2 User interface Extends L<"User interface" in IOMux::Handler|IOMux::Handler/"User interface">. =head3 Connection Extends L<"Connection" in IOMux::Handler|IOMux::Handler/"Connection">. =over 4 =item $obj-EB( [$callback] ) Inherited, see L =item $obj-EB( [$timeout] ) Inherited, see L =back =head3 Reading =over 4 =item $obj-EB($callback) Read a single line (bytes upto a LF or CRLF). After the whole line has arrived, the $callback will be invoked with the received line as parameter. that line is terminated by a LF (\n), even when the file contains CRLF or CR endings. At end of file, the last fragment will be returned. =item $obj-EB($callback) Read all remaining data from a resource. After everything has been read, it will be returned as SCALAR (string reference) example: my $pwd = $mux->open('<', '/etc/passwd'); my $data = $pwd->slurp; my $size = length $$data; =back =head2 Multiplexer Extends L<"Multiplexer" in IOMux::Handler|IOMux::Handler/"Multiplexer">. =head3 Connection Extends L<"Connection" in IOMux::Handler|IOMux::Handler/"Connection">. =over 4 =item $obj-EB( $mux, [$handler] ) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =back =head3 Reading Extends L<"Reading" in IOMux::Handler|IOMux::Handler/"Reading">. =over 4 =item $obj-EB($input) This is called when an end-of-file condition is present on the handle. Like L, it is also passed a reference to the input buffer. You should consume the entire buffer or else it will just be lost. =item $obj-EB($fileno) Inherited, see L =item $obj-EB($buffer) Called when new input has arrived on the input. It is passed a B to the input $buffer. It must remove any input that it you have consumed from the $buffer, and leave any partially received data in there. example: sub muxInput { my ($self, $inbuf) = @_; # Process each whole line in the input, leaving partial # lines in the input buffer for more. while($$inbuf =~ s/^(.*?)\r?\n// ) { $self->process_command($1); } } =item $obj-EB($fileno) Inherited, see L =back =head3 Writing Extends L<"Writing" in IOMux::Handler|IOMux::Handler/"Writing">. =over 4 =item $obj-EB($fileno) Inherited, see L =back =head3 Service Extends L<"Service" in IOMux::Handler|IOMux::Handler/"Service">. =head2 Helpers Extends L<"Helpers" in IOMux::Handler|IOMux::Handler/"Helpers">. =over 4 =item $obj-EB(HASH) =item IOMux::Handler::Read-EB(HASH) Inherited, see L =item $obj-EB($state, $read, $write, $error) Inherited, see L =item $obj-EB() Inherited, see L =back =head1 SEE ALSO This module is part of IOMux distribution version 1.01, built on January 15, 2020. Website: F =head1 LICENSE Copyrights 2011-2020 by [Mark Overmeer ]. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See F