There is a problem in MiniMyth.pm's mythfrontend_networkcontrol() function:
- Code: Select all
sub mythfrontend_networkcontrol {
my $self = shift;
my $command = shift;
my @lines = ();
my $port = $self->mythdb_settings_get('NetworkControlPort');
my $prompt = '/\# $/';
my $telnet = new Net::Telnet(
'Timeout' => '10',
'Errmode' => 'return',
'Host' => 'localhost',
'Port' => $port,
'Prompt' => $prompt);
if (($telnet) && ($telnet->open())) {
$telnet->waitfor($prompt);
@lines = $telnet->cmd($command);
$telnet->cmd('exit');
$telnet->close;
chomp @lines;
}
The problem line is:
- Code: Select all
if (($telnet) && ($telnet->open())) {
It tries to open the socket twice and it leads to falling the function to timeout every time we run mm_sleep command while watching live tv, witch lead to huge delay about 30 seconds or more before system goes to sleep.
I find out that following works instead of that line:
- Code: Select all
if ($telnet) {
PS:
This is a excerpt from the CPAN Net::Telnet's description of the new method:
$obj = new Net::Telnet ([$host]);
..SKIPPED..
If the $host argument is given then the object is opened by connecting to TCP $port on $host.
