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

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^6: Timeout on UDP receiving (Windows)
by ikkeniet (Acolyte) on Nov 02, 2008 at 15:58 UTC
    Thanks for your help. I managed to get it to work. Original code came from a French article regarding VoIP.
      Could you provide the entire script. I have the same one (from VoIP hacks) and am having the same timeout issues. I have tried implementing the changes from this thread without much luck. Cheers.