![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
use Socket; # optional use Net::Gen; # optional use Net::Inet; # optional use Net::UDP;
Net::UDP
module provides services for UDP communications over sockets. It is layered
atop the Net::Inet
and Net::Gen
modules, which are part of the same distribution.
Net::UDP
module itself, rather than just being inherited from Net::Inet
or
Net::Gen
.
$obj = new Net::UDP; $obj = new Net::UDP $host, $service; $obj = new Net::UDP \%parameters; $obj = new Net::UDP $host, $service, \%parameters;
Returns a newly-initialised object of the given class. If called for a
derived class, no validation of the supplied parameters will be performed.
(This is so that the derived class can add the parameter validation it
needs to the object before allowing the validation.) Otherwise, it will
cause the parameters to be validated by calling its init
method, which Net::UDP
inherits from Net::Inet
. In particular, this means that if both a host and a service are given,
that an object will only be returned if a connect()
call was
successful.
Net::UDP
module itself.
Net::UDP
module itself.
TIESCALAR
method of Net::Gen
. That method only succeeds if a call to a new method results in an object for which the isconnected
method returns true, which is why it is mentioned in connection with this
module.
Example:
tie $x,Net::UDP,0,'daytime' or die; $x = "\n"; $x = "\n"; print $y if defined($y = $x); untie $x;
This is an expensive re-implementation of date
on many machines.
Each assignment to the tied scalar is really a call to the put
method (via the STORE
method), and each read from the tied scalar is really a call to the getline
method (via the
FETCH
method).
$CommentsMailTo = "perl5@dcs.ed.ac.uk"; include("../syssies_footer.inc");?>