Browse Source

Set timeout of 3s for send/receive socket operations

pull/247/head
Lucian Balaceanu 10 years ago
parent
commit
25bbf03601
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      utils/rtpengine-ctl

+ 5
- 1
utils/rtpengine-ctl View File

@ -38,7 +38,11 @@ my $socket = new IO::Socket::INET (
Proto => 'tcp',
);
die "Cannot connect to the rtpengine $!\n" unless $socket;
#set send/recv timeout so script doesn't hang when rtpengine doesn't interact
setsockopt($socket, SOL_SOCKET, SO_SNDTIMEO, pack('L!L!', 3, 0) ) or die $!;
setsockopt($socket, SOL_SOCKET, SO_RCVTIMEO, pack('L!L!', 3, 0) ) or die $!;
$argumentstring = trim($argumentstring);
my $size = $socket->send($argumentstring);


Loading…
Cancel
Save