blib/lib/Devel/Trepan/IO/FIFOBase.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 37 CC 2 SCAR 11.0
CC
2
Cov
0%
close
6.0
is_disconnected
2.0
autoflush
2.0
CRAP 3.0
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014 Rocky Bernstein <rocky@cpan.org>
3 # Debugger Input/Output FIFO base Interface.
4  
5 use warnings; use strict;
6  
7 use rlib '../../..';
8  
9 # Debugger Client Input/Output Socket.
10 package Devel::Trepan::IO::FIFOBase;
11  
12 # Closes server connection.
13 # FIXME dry with FIFOClient by making a common FIFO routine
14 sub close
15 {
16 my $self = shift;
17 $self->{state} = 'closing';
18 foreach my $FIFO ( $self->{input_name}, $self->{output_name} ) {
19 close($FIFO);
20 }
21 $self->{state} = 'uninit';
22 $self->{input} = $self->{output} = undef;
23 print {$self->{logger}} "Disconnected\n" if $self->{logger};
24 }
25  
26  
27 sub is_disconnected($)
28 {
29 my $self = shift;
30 return 'disconnected' eq $self->{state};
31 }
32  
33 sub autoflush {
34 my ($self, $fh) = @_;
35 my $o = select($fh);
36 $|++;
37 select($o);
38 }
39  
40 sub have_term_readline($)
41 {
42 return 0;
43 }
44  
45 1;