.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "POE::Driver::SysRW 3" .TH POE::Driver::SysRW 3 2024-07-13 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME POE::Driver::SysRW \- buffered, non\-blocking I/O using sysread and syswrite .SH SYNOPSIS .IX Header "SYNOPSIS" "SYNOPSIS" in POE::Driver illustrates how the interface works. This module is merely one implementation. .SH DESCRIPTION .IX Header "DESCRIPTION" This driver implements POE::Driver using sysread and syswrite. .SH "PUBLIC METHODS" .IX Header "PUBLIC METHODS" POE::Driver::SysRW introduces some additional features not covered in the base interface. .SS "new [BlockSize => OCTETS]" .IX Subsection "new [BlockSize => OCTETS]" \&\fBnew()\fR creates a new buffered I/O driver that uses \fBsysread()\fR to read data from a handle and \fBsyswrite()\fR to flush data to that handle. The constructor accepts one optional named parameter, \f(CW\*(C`BlockSize\*(C'\fR, which indicates the maximum number of OCTETS that will be read at one time. .PP \&\f(CW\*(C`BlockSize\*(C'\fR is 64 kilobytes (65536 octets) by default. Higher values may improve performance in streaming applications, but the trade-off is a lower event granularity and increased resident memory usage. .PP Lower \f(CW\*(C`BlockSize\*(C'\fR values reduce memory consumption somewhat with corresponding throughput penalties. .PP .Vb 1 \& my $driver = POE::Driver::SysRW\->new; \& \& my $driver = POE::Driver::SysRW\->new( BlockSize => $block_size ); .Ve .PP Drivers are commonly instantiated within POE::Wheel constructor calls: .PP .Vb 6 \& $_[HEAP]{wheel} = POE::Wheel::ReadWrite\->new( \& InputHandle => \e*STDIN, \& OutputHandle => \e*STDOUT, \& Driver => POE::Driver::SysRW\->new(), \& Filter => POE::Filter::Line\->new(), \& ); .Ve .PP Applications almost always use POE::Driver::SysRW, so POE::Wheel objects almost always will create their own if no Driver is specified. .SS "All Other Methods" .IX Subsection "All Other Methods" POE::Driver::SysRW documents the abstract interface documented in POE::Driver. Please see POE::Driver for more details about the following methods: .IP flush 4 .IX Item "flush" .PD 0 .IP get 4 .IX Item "get" .IP get_out_messages_buffered 4 .IX Item "get_out_messages_buffered" .IP put 4 .IX Item "put" .PD .SH "SEE ALSO" .IX Header "SEE ALSO" POE::Driver, POE::Wheel. .PP Also see the SEE ALSO section of POE, which contains a brief roadmap of POE's documentation. .SH "AUTHORS & COPYRIGHTS" .IX Header "AUTHORS & COPYRIGHTS" Please see POE for more information about authors and contributors.