D/N/A project
A new way of using
Domain Name Service

Documents :: API

RNA::Net::UDP


NAME

RNA::Net::UDP


DESCRIPTION

This module is part of the RNA Server Project. RNA is an acronym for Domain Name Anarchy. For further informations take a look at RNA man page.

This module provides RNA all the functionalities needed to talk using UDP datagrams.


API

udp_socket()

A simple subroutine which create a UDP socket and return it.

udp_bind($socket, $interface, $port)

Binds $socket to specified $interface at port 53. Return 1 if all went ok, 0 otherwise.

udp_send( $socket, $data, $flags, $ip )

Send a UDP datagram to $ip which is a packed structure of sender informations, $data is the data to be sent. $socket is an optional argument. If not passed, a new UPD socket is created automagically. $flags is a hash reference which holds all the flags to be passed to system call. Can be omitted. See udp_recv() for flags scheme.

udp_recv($socket, $flags)

Riceive udp packets from specified socket. $flags is an optional hash reference, which holds flags to be activated. Format is:

        $flags = {
                MSG_DONTWAIT = 1,
                ....
        };

udp_recv_timeout($socket, $delay, $cycles, $flags)

udp_recv_timeout() is identical to udp_recv, but adds support for timeouted blocking operations. $delay is an arbitrary interval used as delay between read attempts. $clycles is an integer number specifying how many $delay intervals has to be waited, checking each time for data to be read. Default values are 1 for both $delay and $cycles.

pack_flags($flags) [internal]

Prepare a bitmask to be passed to &udp_send() and $udp_recv() for operation tuning. $flags is a hash reference containing the complete sequnce of flags to be activated. If not provided, %DEFAULT_FLAGS is used. %DEFAULT_FLAGS is defined inside RNA::Net::UDP module.

For a list of MSG_* flags, please consult your local send(2) or recv(2) manpage.


AUTHOR

Tx0


SEE ALSO

RNA, RNA::Internals, RNA::Internode, RNA::Net, RNA::Internals, rnad(8), Net::DNS, Net::DNS::Header

This page last modified: Wednesday, 09-Jan-2008 16:25:01 CET
© 2007-2008 Tx0 - Some right reserved
This work is released under Creative Commons License
hosted by gna!
Valid HTML 4.01 Transitional
Valid CSS!