mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
24_TPLinkHS110: Implemented retry on connect timeout
git-svn-id: https://svn.fhem.de/fhem/trunk@14309 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9d3b98b4ec
commit
7281a8f0f9
@ -99,7 +99,12 @@ sub TPLinkHS110_Get($$)
|
||||
Type => SOCK_STREAM,
|
||||
Timeout => $hash->{TIMEOUT} )
|
||||
or return "Couldn't connect to $remote_host:$remote_port: $@\n";
|
||||
$socket->send($c);
|
||||
eval {
|
||||
$socket->send($c);
|
||||
} or do {
|
||||
Log3 $hash, 2, "TPLinkHS110: $name error sending. Retrying one more time.";
|
||||
$socket->send($c);
|
||||
};
|
||||
my $data;
|
||||
my $retval = $socket->recv($data,8192);
|
||||
$socket->close();
|
||||
@ -134,7 +139,12 @@ sub TPLinkHS110_Get($$)
|
||||
Type => SOCK_STREAM,
|
||||
Timeout => $hash->{TIMEOUT} )
|
||||
or return "Couldn't connect to $remote_host:$remote_port: $@\n";
|
||||
$socket->send($rc);
|
||||
eval {
|
||||
$socket->send($c);
|
||||
} or do {
|
||||
Log3 $hash, 2, "TPLinkHS110: $name error sending. Retrying one more time.";
|
||||
$socket->send($c);
|
||||
};
|
||||
my $rdata;
|
||||
$retval = $socket->recv($rdata,8192);
|
||||
$socket->close();
|
||||
@ -164,7 +174,12 @@ sub TPLinkHS110_Get($$)
|
||||
Type => SOCK_STREAM,
|
||||
Timeout => $hash->{TIMEOUT} )
|
||||
or return "Couldn't connect to $remote_host:$remote_port: $@\n";
|
||||
$socket->send($c);
|
||||
eval {
|
||||
$socket->send($c);
|
||||
} or do {
|
||||
Log3 $hash, 2, "TPLinkHS110: $name error sending. Retrying one more time.";
|
||||
$socket->send($c);
|
||||
};
|
||||
my $data;
|
||||
$retval = $socket->recv($data,8192);
|
||||
$socket->close();
|
||||
@ -221,7 +236,12 @@ sub TPLinkHS110_Set($$)
|
||||
Type => SOCK_STREAM,
|
||||
Timeout => $hash->{TIMEOUT})
|
||||
or return "Couldn't connect to $remote_host:$remote_port: $@\n";
|
||||
$socket->send($c);
|
||||
eval {
|
||||
$socket->send($c);
|
||||
} or do {
|
||||
Log3 $hash, 2, "TPLinkHS110: $name error sending. Retrying one more time.";
|
||||
$socket->send($c);
|
||||
};
|
||||
my $data;
|
||||
my $retval = $socket->recv($data,8192);
|
||||
$socket->close();
|
||||
@ -310,7 +330,12 @@ sub TPLinkHS110_Attr {
|
||||
Type => SOCK_STREAM,
|
||||
Timeout => $hash->{TIMEOUT} )
|
||||
or return "Couldn't connect to $remote_host:$remote_port: $@\n";
|
||||
$socket->send($c);
|
||||
eval {
|
||||
$socket->send($c);
|
||||
} or do {
|
||||
Log3 $hash, 2, "TPLinkHS110: $name error sending. Retrying one more time.";
|
||||
$socket->send($c);
|
||||
};
|
||||
my $data;
|
||||
my $retval = $socket->recv($data,8192);
|
||||
$socket->close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user