IO-Handle-Record

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

  Exceptions
    *   "IO::Handle::Record: sysread"

        thrown in "read_record". Check $! for more information.

    *   "IO::Handle::Record: premature end of file"

        thrown in "read_record" on end of file if according to the internal
        protocol more input is expected.

    *   "IO::Handle::Record: busy"

        thrown in "write_record" if a non-blocking write is not yet
        finished. There may be only one write operation at a time. If that
        hits you organise a queue.

    *   "IO::Handle::Record: syswrite"

        thrown in "write_record" on an error of the underlying transport
        method. Check $! for more information.

lib/IO/Handle/Record.pm  view on Meta::CPAN


sub write_record {
  my $I=shift;

  my $writer=(issock($I)
	      ? sub { sendmsg( $_[0], $_[1], $_[2], (@_>3?$_[3]:0) ); }
	      : sub { syswrite $_[0], $_[1], $_[2], (@_>3?$_[3]:()); });

  my $can_fds_to_send=$I->can('fds_to_send');
  if( @_ ) {
    croak "IO::Handle::Record: busy"
      if( defined $I->write_buffer );
    my $L=($I->record_opts && $I->record_opts->{local_encoding}) ? 'L' : 'N';
    my $msg=eval {
      local $Storable::Deparse;
      local $Storable::forgive_me;
      $I->record_opts and do {
	$Storable::forgive_me=$I->record_opts->{forgive_me};
	$Storable::Deparse=$I->record_opts->{send_CODE};
      };
      local $SIG{__WARN__}=sub {};

lib/IO/Handle/Record.pm  view on Meta::CPAN


=item * C<IO::Handle::Record: sysread>

thrown in C<read_record>. Check C<$!> for more information.

=item * C<IO::Handle::Record: premature end of file>

thrown in C<read_record> on end of file if according to the internal
protocol more input is expected.

=item * C<IO::Handle::Record: busy>

thrown in C<write_record> if a non-blocking write is not yet finished. There
may be only one write operation at a time. If that hits you organise a queue.

=item * C<IO::Handle::Record: syswrite>

thrown in C<write_record> on an error of the underlying transport method.
Check C<$!> for more information.

=item * Other exceptions



( run in 0.240 second using v1.01-cache-2.11-cpan-87723dcf8b7 )