NAME
Net::UDP - UDP sockets interface module
SYNOPSIS
use Socket; # optional
use Net::Gen; # optional
use Net::Inet; # optional
use Net::UDP;
DESCRIPTION
The 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.
Public Methods
The following methods are provided by the Net::UDP
module itself, rather than just being inherited from Net::Inet
or Net::Gen
.
- new
-
Usage:
$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, whichNet::UDP
inherits fromNet::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.
Protected Methods
none.
Known Socket Options
There are no object parameters registered by the Net::UDP
module itself.
Known Object Parameters
There are no object parameters registered by the Net::UDP
module itself.
TIESCALAR
Tieing of scalars to a UDP handle is supported by inheritance from the 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).
Exports
none
AUTHOR
Spider Boardman <spider@Orb.Nashua.NH.US>