« blib/lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Interactive.pm
↑ Summary
blib/lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Timer.pm »
| 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; |