Skip to content

Commit

Permalink
add a small delay between each message
Browse files Browse the repository at this point in the history
  • Loading branch information
maddingue committed Sep 17, 2012
1 parent 8a9ecea commit 573d281
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions t/facilities-routing.t
Expand Up @@ -66,6 +66,7 @@ if ($child_pid) {
else { else {
# child: send messages to the syslog server # child: send messages to the syslog server
sleep 2; sleep 2;
my $delay = .01;
setlogsock({ host => $host, type => $proto, port => $port }); setlogsock({ host => $host, type => $proto, port => $port });


# first way, set the facility each time with openlog() # first way, set the facility each time with openlog()
Expand All @@ -75,6 +76,7 @@ else {
for my $level (@levels) { for my $level (@levels) {
eval { syslog($level => "<$facility\:$level>") } eval { syslog($level => "<$facility\:$level>") }
or warn "error: syslog($level => '<$facility\:$level>'): $@"; or warn "error: syslog($level => '<$facility\:$level>'): $@";
select undef, undef, undef, $delay;
} }
} }


Expand All @@ -86,6 +88,7 @@ else {
for my $level (@levels) { for my $level (@levels) {
eval { syslog("$facility.$level" => "<$facility\:$level>") } eval { syslog("$facility.$level" => "<$facility\:$level>") }
or warn "error: syslog('$facility.$level' => '<$facility\:$level>'): $@"; or warn "error: syslog('$facility.$level' => '<$facility\:$level>'): $@";
select undef, undef, undef, $delay;
} }
} }


Expand Down

0 comments on commit 573d281

Please sign in to comment.