in reply to udp recv question
use IO::Socket; use strict; use warnings; my $sock = IO::Socket::INET->new( PeerAddr => 'localhost:9999', Proto=>'udp', ) or die "sock new: $!\n"; my $result; $sock->send("abc",0) or die "send: $!\n"; defined($sock->recv($result,1,0)) or die "recv: $!\n";
For a destination port that isn't open, this code outputs:
recv: Connection refused
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: udp recv question
by smackdab (Pilgrim) on Jun 29, 2004 at 02:57 UTC | |
|
Re^2: udp recv question
by JamesNC (Chaplain) on Jun 29, 2004 at 10:30 UTC | |
by dave_the_m (Monsignor) on Jun 29, 2004 at 12:31 UTC |