version 1.20, 2001/11/27 23:11:42
|
version 1.21, 2001/11/28 21:19:58
|
Line 16
|
Line 16
|
# 12/05 Scott Harrison |
# 12/05 Scott Harrison |
# 12/05 Gerd Kortemeyer |
# 12/05 Gerd Kortemeyer |
# 01/10/01 Scott Harrison |
# 01/10/01 Scott Harrison |
# 03/14/01,03/15,06/12,11/26,11/27 Gerd Kortemeyer |
# 03/14/01,03/15,06/12,11/26,11/27,11/28 Gerd Kortemeyer |
# |
# |
# based on nonforker from Perl Cookbook |
# based on nonforker from Perl Cookbook |
# - server who multiplexes without forking |
# - server who multiplexes without forking |
Line 182 sub subreply {
|
Line 182 sub subreply {
|
Type => SOCK_STREAM, |
Type => SOCK_STREAM, |
Timeout => 10) |
Timeout => 10) |
or return "con_lost"; |
or return "con_lost"; |
|
|
|
|
$SIG{ALRM}=sub { die "timeout" }; |
$SIG{ALRM}=sub { die "timeout" }; |
$SIG{__DIE__}='DEFAULT'; |
$SIG{__DIE__}='DEFAULT'; |
eval { |
eval { |
alarm(10); |
alarm(10); |
print $sclient "$cmd\n"; |
print $sclient "$cmd\n"; |
my $answer=<$sclient>; |
$answer=<$sclient>; |
chomp($answer); |
chomp($answer); |
alarm(0); |
alarm(0); |
}; |
}; |