{
    "mode": "perldoc",
    "parameter": "IO::Socket::INET6",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/IO%3A%3ASocket%3A%3AINET6/json",
    "generated": "2026-06-09T18:06:09Z",
    "synopsis": "use IO::Socket::INET6;",
    "sections": {
        "NAME": {
            "content": "IO::Socket::INET6 - [ DEPRECATED!! ] Object interface for AFINET/AFINET6 domain sockets\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use IO::Socket::INET6;\n",
            "subsections": []
        },
        "WARNING": {
            "content": "WARNING!! IO-Socket-INET6 is deprecated.\n\nIO-Socket-INET6 was now succeeded by Paul Evans' IO::Socket::IP . Please convert old code from\nIO-Socket-INET6 to IO-Socket-IP.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"IO::Socket::INET6\" provides an object interface to creating and using sockets in either AFINET\nor AFINET6 domains. It is built upon the IO::Socket interface and inherits all the methods\ndefined by IO::Socket.\n",
            "subsections": []
        },
        "CONSTRUCTOR": {
            "content": "new ( [ARGS] )\nCreates an \"IO::Socket::INET6\" object, which is a reference to a newly created symbol (see\nthe \"Symbol\" package). \"new\" optionally takes arguments, these arguments are in key-value\npairs.\n\nIn addition to the key-value pairs accepted by IO::Socket, \"IO::Socket::INET6\" provides.\n\nDomain      Address family               AFINET | AFINET6 | AFUNSPEC (default)\nPeerAddr    Remote host address          <hostname>[:<port>]\nPeerHost    Synonym for PeerAddr\nPeerPort    Remote port or service       <service>[(<no>)] | <no>\nPeerFlow    Remote flow information\nPeerScope   Remote address scope\nLocalAddr   Local host bind address      hostname[:port]\nLocalHost   Synonym for LocalAddr\nLocalPort   Local host bind port         <service>[(<no>)] | <no>\nLocalFlow   Local host flow information\nLocalScope  Local host address scope\nProto       Protocol name (or number)    \"tcp\" | \"udp\" | ...\nType        Socket type                  SOCKSTREAM | SOCKDGRAM | ...\nListen      Queue size for listen\nReuseAddr   Set SOREUSEADDR before binding\nReuse       Set SOREUSEADDR before binding (deprecated, prefer ReuseAddr)\nReusePort   Set SOREUSEPORT before binding\nBroadcast   Set SOBROADCAST before binding\nTimeout     Timeout value for various operations\nMultiHomed  Try all addresses for multi-homed hosts\nBlocking    Determine if connection will be blocking mode\n\nIf \"Listen\" is defined then a listen socket is created, else if the socket type, which is\nderived from the protocol, is SOCKSTREAM then connect() is called.\n\nAlthough it is not illegal, the use of \"MultiHomed\" on a socket which is in non-blocking\nmode is of little use. This is because the first connect will never fail with a timeout as\nthe connect call will not block.\n\nThe \"PeerAddr\" can be a hostname, the IPv6-address on the \"2001:800:40:2a05::10\" form , or\nthe IPv4-address on the \"213.34.234.245\" form. The \"PeerPort\" can be a number or a symbolic\nservice name. The service name might be followed by a number in parenthesis which is used if\nthe service is not known by the system. The \"PeerPort\" specification can also be embedded in\nthe \"PeerAddr\" by preceding it with a \":\", and closing the IPv6 address on brackets \"[]\" if\nnecessary: \"124.678.12.34:23\",\"[2a05:345f::10]:23\",\"any.server.com:23\".\n\nIf \"Domain\" is not given, AFUNSPEC is assumed, that is, both AFINET and AFINET6 will be\nboth considered when resolving DNS names. AFINET6 has priority. If you guess you are in\ntrouble not reaching the peer,(the service is not available via AFINET6 but AFINET) you\ncan either try Multihomed (try any address/family until reach) or concrete your address\n\"family\" (AFINET, AFINET6).\n\nIf \"Proto\" is not given and you specify a symbolic \"PeerPort\" port, then the constructor\nwill try to derive \"Proto\" from the service name. As a last resort \"Proto\" \"tcp\" is assumed.\nThe \"Type\" parameter will be deduced from \"Proto\" if not specified.\n\nIf the constructor is only passed a single argument, it is assumed to be a \"PeerAddr\"\nspecification.\n\nIf \"Blocking\" is set to 0, the connection will be in nonblocking mode. If not specified it\ndefaults to 1 (blocking mode).\n\nExamples:\n\n$sock = IO::Socket::INET6->new(PeerAddr => 'www.perl.org',\nPeerPort => 'http(80)',\nProto    => 'tcp');\n\nSuppose either you have no IPv6 connectivity or www.perl.org has no http service on IPv6.\nThen,\n\n(Trying all address/families until reach)\n\n$sock = IO::Socket::INET6->new(PeerAddr => 'www.perl.org',\nPeerPort => 'http(80)',\nMultihomed => 1 ,\nProto    => 'tcp');\n\n(Concrete to IPv4 protocol)\n\n$sock = IO::Socket::INET6->new(PeerAddr => 'www.perl.org',\nPeerPort => 'http(80)',\nDomain => AFINET ,\nProto    => 'tcp');\n\n\n$sock = IO::Socket::INET6->new(PeerAddr => 'localhost:smtp(25)');\n\n$sock = IO::Socket::INET6->new(Listen    => 5,\nLocalAddr => 'localhost',\nLocalPort => 9000,\nProto     => 'tcp');\n\n$sock = IO::Socket::INET6->new('[::1]:25');\n\n$sock = IO::Socket::INET6->new(PeerPort  => 9999,\nPeerAddr  => Socket6::inetntop(AFINET6,in6addrbroadcast),\nProto     => udp,\nLocalAddr => 'localhost',\nBroadcast => 1 )\nor die \"Can't bind : $@\\n\";\n\nNOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n\nAs of VERSION 1.18 all IO::Socket objects have autoflush turned on by default. This was not\nthe case with earlier releases.\n\nNOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n\nMETHODS\naccept ()\nSee IO::Socket::INET.\n\nbind ()\nSee IO::Socket::INET.\n\nconfigure ()\nThis function exists in this module, but I (= Shlomi Fish) don't know what it does, or\nunderstand it. It's also not tested anywhere. I'll be happy to be enlightened.\n\nconnect ()\nSee IO::Socket::INET.\n\nsockaddr ()\nReturn the address part of the sockaddr structure for the socket\n",
            "subsections": [
                {
                    "name": "sockdomain",
                    "content": "Returns the domain of the socket - AFINET or AFINET6 or whatever.\n\nsockport ()\nReturn the port number that the socket is using on the local host\n\nsockhost ()\nReturn the address part of the sockaddr structure for the socket in a text form\n(\"2001:800:40:2a05::10\" or \"245.245.13.27\")\n\nsockflow ()\nReturn the flow information part of the sockaddr structure for the socket\n\nsockscope ()\nReturn the scope identification part of the sockaddr structure for the socket\n\npeeraddr ()\nReturn the address part of the sockaddr structure for the socket on the peer host\n\npeerport ()\nReturn the port number for the socket on the peer host.\n\npeerhost ()\nReturn the address part of the sockaddr structure for the socket on the peer host in a text\nform (\"2001:800:40:2a05::10\" or \"245.245.13.27\")\n\npeerflow ()\nReturn the flow information part of the sockaddr structure for the socket on the peer host\n\npeerscope ()\nReturn the scope identification part of the sockaddr structure for the socket on the peer\nhost\n"
                }
            ]
        },
        "REPOSITORY": {
            "content": "The Subversion repository for this module carrying complete version history and other\ninformation is:\n\n<http://svn.berlios.de/svnroot/repos/web-cpan/IO-Socket-INET6/>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Socket,Socket6, IO::Socket\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "This program is based on IO::Socket::INET by Graham Barr <gbarr@pobox.com> and currently\nmaintained by the Perl Porters.\n\nModified by Rafael Martinez Torres <rafael.martinez@novagnet.com> and Euro6IX project.\n\nModified further by Shlomi Fish <shlomif@iglu.org.il>, while disclaiming all copyrights.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (c) 2003- Rafael Martinez Torres <rafael.martinez@novagnet.com>.\n\nCopyright (c) 2003- Euro6IX project.\n\nCopyright (c) 1996-8 Graham Barr <gbarr@pobox.com>.\n\nAll rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        }
    },
    "summary": "IO::Socket::INET6 - [ DEPRECATED!! ] Object interface for AFINET/AFINET6 domain sockets",
    "flags": [],
    "examples": [],
    "see_also": []
}