in reply to Re^4: Timeout on UDP receiving (Windows)
in thread Timeout on UDP receiving (Windows)
Hm. Did you write this code?
This might work or it might not. I cannot test it so you will have to and solve whatever problems you encounter.
Try adding the subroutine I posted above to the script.And then replace this chunk of code:
# obtient la réponse eval { local $SIG{ALRM} = sub { die "temporisation de l'a +larme" }; alarm $RECV_TIMEOUT; $portaddr = recv($sock, $packet, 1500, 0) or die "Réception impossible: $!"; alarm 0; 1; } or die($@); # affiche la sortie
with:
# obtient la réponse my(undef,undef,$packet) = recv_timeout( $sock, $RECV_T +IMEOUT ); die "temporisation de l'alarme" } unless $packet; # affiche la sortie
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Timeout on UDP receiving (Windows)
by ikkeniet (Acolyte) on Nov 02, 2008 at 15:58 UTC | |
by cmochile (Initiate) on Jan 18, 2009 at 23:45 UTC |