2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

Made the third argument optional

git-svn-id: https://svn.fhem.de/fhem/trunk@2386 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2012-12-29 15:10:30 +00:00
parent a62471a6bb
commit ca1fb7f973

View File

@ -2,24 +2,22 @@
# $Id: $
package main;
use strict;
use warnings;
use IO::Socket::INET;
sub BlockingCall($$$$);
=pod
### Usage:
sub TestBlocking() { BlockingCall("DoSleep", 5, "SleepDone", 8); }
sub DoSleep($) { sleep(shift); return "I'm done"; }
sub SleepDone($) { Log 1, "SleepDone: " . shift; }
=cut
use strict;
use warnings;
use IO::Socket::INET;
sub BlockingCall($$@);
sub
BlockingCall($$$$)
BlockingCall($$@)
{
my ($blockingFn, $arg, $finishFn, $timeout) = @_;
@ -40,6 +38,8 @@ BlockingCall($$$$)
my $ret = &{$blockingFn}($arg);
use strict "refs";
exit(0) if(!$finishFn);
# Look for the telnetport
my $tp;
foreach my $d (sort keys %defs) {