{
    "content": [
        {
            "type": "text",
            "text": "# IO::Socket::UNIX (perldoc)\n\n## NAME\n\nIO::Socket::UNIX - Object interface for AFUNIX domain sockets\n\n## SYNOPSIS\n\nuse IO::Socket::UNIX;\nmy $SOCKPATH = \"$ENV{HOME}/unix-domain-socket-test.sock\";\n# Server:\nmy $server = IO::Socket::UNIX->new(\nType => SOCKSTREAM(),\nLocal => $SOCKPATH,\nListen => 1,\n);\nmy $count = 1;\nwhile (my $conn = $server->accept()) {\n$conn->print(\"Hello \" . ($count++) . \"\\n\");\n}\n# Client:\nmy $client = IO::Socket::UNIX->new(\nType => SOCKSTREAM(),\nPeer => $SOCKPATH,\n);\n# Now read and write from $client\n\n## DESCRIPTION\n\n\"IO::Socket::UNIX\" provides an object interface to creating and using sockets in the AFUNIX\ndomain. It is built upon the IO::Socket interface and inherits all the methods defined by\nIO::Socket.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CONSTRUCTOR**\n- **METHODS** (2 subsections)\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "IO::Socket::UNIX",
        "section": "",
        "mode": "perldoc",
        "summary": "IO::Socket::UNIX - Object interface for AFUNIX domain sockets",
        "synopsis": "use IO::Socket::UNIX;\nmy $SOCKPATH = \"$ENV{HOME}/unix-domain-socket-test.sock\";\n# Server:\nmy $server = IO::Socket::UNIX->new(\nType => SOCKSTREAM(),\nLocal => $SOCKPATH,\nListen => 1,\n);\nmy $count = 1;\nwhile (my $conn = $server->accept()) {\n$conn->print(\"Hello \" . ($count++) . \"\\n\");\n}\n# Client:\nmy $client = IO::Socket::UNIX->new(\nType => SOCKSTREAM(),\nPeer => $SOCKPATH,\n);\n# Now read and write from $client",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 24,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "CONSTRUCTOR",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "hostpath",
                        "lines": 2
                    },
                    {
                        "name": "peerpath",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "IO::Socket::UNIX - Object interface for AFUNIX domain sockets\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use IO::Socket::UNIX;\n\nmy $SOCKPATH = \"$ENV{HOME}/unix-domain-socket-test.sock\";\n\n# Server:\nmy $server = IO::Socket::UNIX->new(\nType => SOCKSTREAM(),\nLocal => $SOCKPATH,\nListen => 1,\n);\n\nmy $count = 1;\nwhile (my $conn = $server->accept()) {\n$conn->print(\"Hello \" . ($count++) . \"\\n\");\n}\n\n# Client:\nmy $client = IO::Socket::UNIX->new(\nType => SOCKSTREAM(),\nPeer => $SOCKPATH,\n);\n\n# Now read and write from $client\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "\"IO::Socket::UNIX\" provides an object interface to creating and using sockets in the AFUNIX\ndomain. It is built upon the IO::Socket interface and inherits all the methods defined by\nIO::Socket.\n",
                "subsections": []
            },
            "CONSTRUCTOR": {
                "content": "new ( [ARGS] )\nCreates an \"IO::Socket::UNIX\" 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::UNIX\" provides.\n\nType        Type of socket (eg SOCKSTREAM or SOCKDGRAM)\nLocal       Path to local fifo\nPeer        Path to peer fifo\nListen      Queue size for listen\n\nIf the constructor is only passed a single argument, it is assumed to be a \"Peer\"\nspecification.\n\nIf the \"Listen\" argument is given, but false, the queue size will be set to 5.\n\nIf the constructor fails it will return \"undef\" and set the $IO::Socket::errstr package\nvariable to contain an error message.\n\n$sock = IO::Socket::UNIX->new(...)\nor die \"Cannot create socket - $IO::Socket::errstr\\n\";\n\nFor legacy reasons the error message is also set into the global $@ variable, and you may\nstill find older code which looks here instead.\n\n$sock = IO::Socket::UNIX->new(...)\nor die \"Cannot create socket - $@\\n\";\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "hostpath",
                        "content": "Returns the pathname to the fifo at the local end\n"
                    },
                    {
                        "name": "peerpath",
                        "content": "Returns the pathanme to the fifo at the peer end\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "Socket, IO::Socket\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Graham Barr. Currently maintained by the Perl Porters. Please report all bugs at\n<https://github.com/Perl/perl5/issues>.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (c) 1996-8 Graham Barr <gbarr@pobox.com>. All rights reserved. This program is free\nsoftware; you can redistribute it and/or modify it under the same terms as Perl itself.\n",
                "subsections": []
            }
        }
    }
}