Michael Robinton > Net-NBsocket > Net::NBsocket

Download:
Net-NBsocket-0.24.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.24   Source  

NAME ^

Net::NBsocket -- Non-Blocking Sockets

SYNOPSIS ^

  use Net::NBsocket qw(
        open_UDP
        open_udpNB
        open_Listen
        open_listenNB
        connectBlk
        connect_NB
        accept_Blk
        accept_NB
        set_NB
        set_so_linger
        dyn_bind
        inet_aton
        inet_ntoa
        sockaddr_in
        sockaddr_un
        inet_pton
        inet_ntop
        ipv6_aton
        ipv6_n2x
        ipv6_n2d
        INADDR_ANY
        INADDR_BROADCAST
        INADDR_LOOPBACK
        INADDR_NONE
        AF_INET
        AF_INET6
        in6addr_any
        in6addr_loopback        
        havesock6
        isupport6
        pack_sockaddr_in6
        unpack_sockaddr_in6
  );

  $sock = open_UDP($af_family);
  $sock = open_udpNB($af_family);
  DEPRECATED $sock = bind2pp($sock,$port_path,$netaddr);
  $listener = open_Listen($port_path,$netaddr,$af_family);
  $listener = open_listenNB($port_path,$netaddr,$af_family);
  $client = connectBlk($port_path,$netaddr,$af_family);
  $client = connect_NB($port_path,$netaddr,$af_family);
  ($sock,$netaddr) = accept_Blk($srvsock);
  ($sock,$netaddr) = accept_NB($srvsock);
  $rv = set_NB($sock);
  $rv = set_so_linger($sock,$seconds);
  $port = dyn_bind($sock,$netaddr);

        IPv4
  $netaddr = inet_aton($dot_quad);
  $dot_quad = inet_ntoa($netaddr);
  $sin = sockaddr_in($port,$netaddr);
  ($port,$netaddr) = sockaddr_in($sin);
  $sun = sockaddr_un($path);
  ($path) = sockaddr_un($sun);

        IPv6
  $netaddr = inet_pton($AF_family,$text_addr);
  $text_addr = inet_ntop($AF_family,$netaddr);
  $ipv6naddr = ipv6_aton($ipv6_text);
  $hex_text = ipv6_n2x($ipv6naddr);
  $dec_text = ipv6_n2d($ipv6naddr);

        CONSTANTS
  $constant = INADDR_ANY();
  $constant = INADDR_BROADCAST();
  $constant = INADDR_LOOPBACK();
  $constant = INADDR_NONE();
  $constant = AF_INET();
  $constant = AF_INET6();
  $constant = in6addr_any();
  $constant = in6addr_loopback();

        IPv6 conditional
  $trueif = havesock6();
  $trueif = isupport6();
  $sockaddr_in6_struct=pack_sockaddr_in6($port,ipv6naddr);
  ($port,$ipv6naddr)=unpack_sockaddr_in6($sockaddr_in6_struct);

DESCRIPTION ^

Net::NBsocket provides a wrapper for Socket and Socket6 to supply Non-Blocking sockets of various flavors;

FUNCTIONS

IPv4 exported from Socket

IPv6 exported from Socket6 & NetAddr::IP::InetBase

CONSTANTS

IPv6 Conditional

DEPENDENCIES ^

        POSIX
        Socket
        NetAddr::IP

EXPORT_OK ^

        open_UDP
        open_udpNB
        open_Listen
        open_listenNB
        connectBlk
        connect_NB
        accept_Blk
        accept_NB
        set_NB
        set_so_linger
        dyn_bind
        inet_aton
        inet_ntoa
        sockaddr_in
        sockaddr_un
        inet_pton
        inet_ntop
        ipv6_aton
        ipv6_n2x
        ipv6_n2d
        INADDR_ANY
        INADDR_BROADCAST
        INADDR_LOOPBACK
        INADDR_NONE
        in6addr_any
        in6addr_loopback        
        AF_INET
        AF_INET6
        havesock6
        isupport6
        pack_sockaddr_in6
        unpack_sockaddr_in6

AUTHOR ^

Michael Robinton, michael@bizsystems.com

COPYRIGHT 2004 - 2014 ^

Michael Robinton

All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of either:

  a) the GNU General Public License as published by the Free
  Software Foundation; either version 2, or (at your option) any
  later version, or

  b) the "Artistic License" which comes with this distribution.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details.

You should have received a copy of the Artistic License with this distribution, in the file named "Artistic". If not, I'll be glad to provide one.

You should also have received a copy of the GNU General Public License along with this program in the file named "Copying". If not, write to the

        Free Software Foundation, Inc.
        59 Temple Place, Suite 330
        Boston, MA  02111-1307, USA

or visit their web page on the internet at:

        http://www.gnu.org/copyleft/gpl.html.

SEE ALSO ^

POSIX, Socket

syntax highlighting: