develooper Front page | perl.perl5.porters | Postings from August 2001

UDP sockets

From:
wk.leong
Date:
August 2, 2001 04:50
Subject:
UDP sockets
Message ID:
1B443293520FD311B84B0008C75BA29A0144E602@sgexmta4.amd.com
below are two ways of creating/receiving with a udp socket using IO::Socket

  $socket1 = new IO::Socket::INET(
    LocalPort=>1234,
    Proto=>'udp'
  );
  recv($socket1,$data,8192,0);

--------------------------------------------------------------

  $socket2 = new IO::Socket::INET(
    PeerAddr=>'165.204.194.92',
    LocalPort=>1234,
    Proto=>'udp'
  );
  recv($socket2,$data,8192,0);

I'm not entirely sure but it seems that ...
socket1 will get all udp messages going to port 1234
socket2 will only get those coming from 165.204.194.92 (not sure but
something weird is happening)

Is this behaviour correct/documented?
Is this a feature or a bug?





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About