{
  "classes": [
    {
      "constants": [],
      "types": [
        {
          "lua_type": "type SocketOption = {\n    level: number,\n    name: number,\n    value: number | boolean,\n}",
          "name": "SocketOption",
          "tags": [],
          "source": {
            "path": "",
            "line": 67
          },
          "fields": [
            {
              "lua_type": "level: number",
              "name": "level",
              "desc": "Protocol level such as `SOL_SOCKET` or `IPPROTO_TCP`."
            },
            {
              "lua_type": "name: number",
              "name": "name",
              "desc": "Option constant such as `SO_REUSEADDR` or `TCP_NODELAY`."
            },
            {
              "lua_type": "value: number | boolean",
              "name": "value",
              "desc": "Value to assign to the option."
            }
          ],
          "desc": "A single socket option assignment used by the higher-level `net` wrappers.\n\nEach entry maps directly to one `setsockopt` call on the underlying socket.\n"
        },
        {
          "lua_type": "type SocketConfig = {\n    family: number?,\n    timeout: number?,\n    blocking: boolean?,\n    socketOptions: { SocketOption }?,\n    reuseAddress: boolean?,\n    keepAlive: boolean?,\n    nodelay: boolean?,\n    broadcast: boolean?,\n    receiveBufferSize: number?,\n    sendBufferSize: number?,\n    ipv6Only: boolean?,\n    localHost: string?,\n    localPort: number?,\n}",
          "name": "SocketConfig",
          "tags": [],
          "source": {
            "path": "",
            "line": 82
          },
          "fields": [
            {
              "lua_type": "family: number?",
              "name": "family",
              "desc": "Address family, typically `AF_INET` or `AF_INET6`."
            },
            {
              "lua_type": "timeout: number?",
              "name": "timeout",
              "desc": "Blocking timeout in seconds. Ignored in non-blocking mode."
            },
            {
              "lua_type": "blocking: boolean?",
              "name": "blocking",
              "desc": "Whether the wrapper should operate in blocking mode. Defaults to `true`."
            },
            {
              "lua_type": "socketOptions: { SocketOption }?",
              "name": "socketOptions",
              "desc": "Extra raw socket options to apply after the socket is created."
            },
            {
              "lua_type": "reuseAddress: boolean?",
              "name": "reuseAddress",
              "desc": "Enables `SO_REUSEADDR`."
            },
            {
              "lua_type": "keepAlive: boolean?",
              "name": "keepAlive",
              "desc": "Enables `SO_KEEPALIVE`."
            },
            {
              "lua_type": "nodelay: boolean?",
              "name": "nodelay",
              "desc": "Enables `TCP_NODELAY` for TCP sockets."
            },
            {
              "lua_type": "broadcast: boolean?",
              "name": "broadcast",
              "desc": "Enables `SO_BROADCAST` for UDP broadcast traffic."
            },
            {
              "lua_type": "receiveBufferSize: number?",
              "name": "receiveBufferSize",
              "desc": "Sets `SO_RCVBUF`."
            },
            {
              "lua_type": "sendBufferSize: number?",
              "name": "sendBufferSize",
              "desc": "Sets `SO_SNDBUF`."
            },
            {
              "lua_type": "ipv6Only: boolean?",
              "name": "ipv6Only",
              "desc": "Sets `IPV6_V6ONLY` on IPv6 sockets."
            },
            {
              "lua_type": "localHost: string?",
              "name": "localHost",
              "desc": "Optional local address to bind before connect."
            },
            {
              "lua_type": "localPort: number?",
              "name": "localPort",
              "desc": "Optional local port to bind before connect."
            }
          ],
          "desc": "Common socket configuration shared by TCP and UDP clients and servers.\n\nAll fields are optional. When omitted, the wrapper chooses sensible defaults\nfor the socket kind being created.\n"
        },
        {
          "lua_type": "type TcpClientOptions = {\n    family: number?,\n    timeout: number?,\n    blocking: boolean?,\n    socketOptions: { SocketOption }?,\n    reuseAddress: boolean?,\n    keepAlive: boolean?,\n    nodelay: boolean?,\n    broadcast: boolean?,\n    receiveBufferSize: number?,\n    sendBufferSize: number?,\n    ipv6Only: boolean?,\n    localHost: string?,\n    localPort: number?,\n}",
          "name": "TcpClientOptions",
          "tags": [],
          "source": {
            "path": "",
            "line": 114
          },
          "fields": [
            {
              "lua_type": "family: number?",
              "name": "family",
              "desc": "Address family, typically `AF_INET` or `AF_INET6`."
            },
            {
              "lua_type": "timeout: number?",
              "name": "timeout",
              "desc": "Blocking timeout in seconds. Ignored in non-blocking mode."
            },
            {
              "lua_type": "blocking: boolean?",
              "name": "blocking",
              "desc": "Whether the wrapper should operate in blocking mode. Defaults to `true`."
            },
            {
              "lua_type": "socketOptions: { SocketOption }?",
              "name": "socketOptions",
              "desc": "Extra raw socket options to apply after the socket is created."
            },
            {
              "lua_type": "reuseAddress: boolean?",
              "name": "reuseAddress",
              "desc": "Enables `SO_REUSEADDR`."
            },
            {
              "lua_type": "keepAlive: boolean?",
              "name": "keepAlive",
              "desc": "Enables `SO_KEEPALIVE`."
            },
            {
              "lua_type": "nodelay: boolean?",
              "name": "nodelay",
              "desc": "Enables `TCP_NODELAY` for TCP sockets."
            },
            {
              "lua_type": "broadcast: boolean?",
              "name": "broadcast",
              "desc": "Enables `SO_BROADCAST` for UDP broadcast traffic."
            },
            {
              "lua_type": "receiveBufferSize: number?",
              "name": "receiveBufferSize",
              "desc": "Sets `SO_RCVBUF`."
            },
            {
              "lua_type": "sendBufferSize: number?",
              "name": "sendBufferSize",
              "desc": "Sets `SO_SNDBUF`."
            },
            {
              "lua_type": "ipv6Only: boolean?",
              "name": "ipv6Only",
              "desc": "Sets `IPV6_V6ONLY` on IPv6 sockets."
            },
            {
              "lua_type": "localHost: string?",
              "name": "localHost",
              "desc": "Optional local address to bind before connect."
            },
            {
              "lua_type": "localPort: number?",
              "name": "localPort",
              "desc": "Optional local port to bind before connect."
            }
          ],
          "desc": "Options for [[TcpClient.new]] and [[TcpClientNonBlocking.new]].\n"
        },
        {
          "lua_type": "type TcpServerOptions = {\n    backlog: number?,\n    mode: \"signal\" | \"manual\"?,\n    handler: (((client: TcpClient) → ()))?,\n    family: number?,\n    timeout: number?,\n    blocking: boolean?,\n    socketOptions: { SocketOption }?,\n    reuseAddress: boolean?,\n    keepAlive: boolean?,\n    nodelay: boolean?,\n    broadcast: boolean?,\n    receiveBufferSize: number?,\n    sendBufferSize: number?,\n    ipv6Only: boolean?,\n    localHost: string?,\n    localPort: number?,\n}",
          "name": "TcpServerOptions",
          "tags": [],
          "source": {
            "path": "",
            "line": 119
          },
          "fields": [
            {
              "lua_type": "backlog: number?",
              "name": "backlog",
              "desc": "Maximum queued connection count passed to `listen`."
            },
            {
              "lua_type": "mode: \"signal\" | \"manual\"?",
              "name": "mode",
              "desc": "`signal` starts a background accept loop; `manual` leaves accepting to the caller."
            },
            {
              "lua_type": "handler: (((client: TcpClient) → ()))?",
              "name": "handler",
              "desc": "Optional convenience handler connected to `onClient`."
            },
            {
              "lua_type": "family: number?",
              "name": "family",
              "desc": "Address family, typically `AF_INET` or `AF_INET6`."
            },
            {
              "lua_type": "timeout: number?",
              "name": "timeout",
              "desc": "Blocking timeout in seconds. Ignored in non-blocking mode."
            },
            {
              "lua_type": "blocking: boolean?",
              "name": "blocking",
              "desc": "Whether the wrapper should operate in blocking mode. Defaults to `true`."
            },
            {
              "lua_type": "socketOptions: { SocketOption }?",
              "name": "socketOptions",
              "desc": "Extra raw socket options to apply after the socket is created."
            },
            {
              "lua_type": "reuseAddress: boolean?",
              "name": "reuseAddress",
              "desc": "Enables `SO_REUSEADDR`."
            },
            {
              "lua_type": "keepAlive: boolean?",
              "name": "keepAlive",
              "desc": "Enables `SO_KEEPALIVE`."
            },
            {
              "lua_type": "nodelay: boolean?",
              "name": "nodelay",
              "desc": "Enables `TCP_NODELAY` for TCP sockets."
            },
            {
              "lua_type": "broadcast: boolean?",
              "name": "broadcast",
              "desc": "Enables `SO_BROADCAST` for UDP broadcast traffic."
            },
            {
              "lua_type": "receiveBufferSize: number?",
              "name": "receiveBufferSize",
              "desc": "Sets `SO_RCVBUF`."
            },
            {
              "lua_type": "sendBufferSize: number?",
              "name": "sendBufferSize",
              "desc": "Sets `SO_SNDBUF`."
            },
            {
              "lua_type": "ipv6Only: boolean?",
              "name": "ipv6Only",
              "desc": "Sets `IPV6_V6ONLY` on IPv6 sockets."
            },
            {
              "lua_type": "localHost: string?",
              "name": "localHost",
              "desc": "Optional local address to bind before connect."
            },
            {
              "lua_type": "localPort: number?",
              "name": "localPort",
              "desc": "Optional local port to bind before connect."
            }
          ],
          "desc": "Options for [[TcpServer.new]].\n"
        },
        {
          "lua_type": "type UdpClientOptions = {\n    family: number?,\n    timeout: number?,\n    blocking: boolean?,\n    socketOptions: { SocketOption }?,\n    reuseAddress: boolean?,\n    keepAlive: boolean?,\n    nodelay: boolean?,\n    broadcast: boolean?,\n    receiveBufferSize: number?,\n    sendBufferSize: number?,\n    ipv6Only: boolean?,\n    localHost: string?,\n    localPort: number?,\n}",
          "name": "UdpClientOptions",
          "tags": [],
          "source": {
            "path": "",
            "line": 131
          },
          "fields": [
            {
              "lua_type": "family: number?",
              "name": "family",
              "desc": "Address family, typically `AF_INET` or `AF_INET6`."
            },
            {
              "lua_type": "timeout: number?",
              "name": "timeout",
              "desc": "Blocking timeout in seconds. Ignored in non-blocking mode."
            },
            {
              "lua_type": "blocking: boolean?",
              "name": "blocking",
              "desc": "Whether the wrapper should operate in blocking mode. Defaults to `true`."
            },
            {
              "lua_type": "socketOptions: { SocketOption }?",
              "name": "socketOptions",
              "desc": "Extra raw socket options to apply after the socket is created."
            },
            {
              "lua_type": "reuseAddress: boolean?",
              "name": "reuseAddress",
              "desc": "Enables `SO_REUSEADDR`."
            },
            {
              "lua_type": "keepAlive: boolean?",
              "name": "keepAlive",
              "desc": "Enables `SO_KEEPALIVE`."
            },
            {
              "lua_type": "nodelay: boolean?",
              "name": "nodelay",
              "desc": "Enables `TCP_NODELAY` for TCP sockets."
            },
            {
              "lua_type": "broadcast: boolean?",
              "name": "broadcast",
              "desc": "Enables `SO_BROADCAST` for UDP broadcast traffic."
            },
            {
              "lua_type": "receiveBufferSize: number?",
              "name": "receiveBufferSize",
              "desc": "Sets `SO_RCVBUF`."
            },
            {
              "lua_type": "sendBufferSize: number?",
              "name": "sendBufferSize",
              "desc": "Sets `SO_SNDBUF`."
            },
            {
              "lua_type": "ipv6Only: boolean?",
              "name": "ipv6Only",
              "desc": "Sets `IPV6_V6ONLY` on IPv6 sockets."
            },
            {
              "lua_type": "localHost: string?",
              "name": "localHost",
              "desc": "Optional local address to bind before connect."
            },
            {
              "lua_type": "localPort: number?",
              "name": "localPort",
              "desc": "Optional local port to bind before connect."
            }
          ],
          "desc": "Options for [[UdpClient.new]].\n"
        },
        {
          "lua_type": "type UdpServerOptions = {\n    mode: \"signal\" | \"manual\"?,\n    handler: (((data: buffer, host: string, port: number) → ()))?,\n    packetSize: number?,\n    family: number?,\n    timeout: number?,\n    blocking: boolean?,\n    socketOptions: { SocketOption }?,\n    reuseAddress: boolean?,\n    keepAlive: boolean?,\n    nodelay: boolean?,\n    broadcast: boolean?,\n    receiveBufferSize: number?,\n    sendBufferSize: number?,\n    ipv6Only: boolean?,\n    localHost: string?,\n    localPort: number?,\n}",
          "name": "UdpServerOptions",
          "tags": [],
          "source": {
            "path": "",
            "line": 136
          },
          "fields": [
            {
              "lua_type": "mode: \"signal\" | \"manual\"?",
              "name": "mode",
              "desc": "`signal` starts a background receive loop; `manual` leaves receiving to the caller."
            },
            {
              "lua_type": "handler: (((data: buffer, host: string, port: number) → ()))?",
              "name": "handler",
              "desc": "Optional convenience handler connected to `onDatagram`."
            },
            {
              "lua_type": "packetSize: number?",
              "name": "packetSize",
              "desc": "Datagram buffer size used by the background receive loop."
            },
            {
              "lua_type": "family: number?",
              "name": "family",
              "desc": "Address family, typically `AF_INET` or `AF_INET6`."
            },
            {
              "lua_type": "timeout: number?",
              "name": "timeout",
              "desc": "Blocking timeout in seconds. Ignored in non-blocking mode."
            },
            {
              "lua_type": "blocking: boolean?",
              "name": "blocking",
              "desc": "Whether the wrapper should operate in blocking mode. Defaults to `true`."
            },
            {
              "lua_type": "socketOptions: { SocketOption }?",
              "name": "socketOptions",
              "desc": "Extra raw socket options to apply after the socket is created."
            },
            {
              "lua_type": "reuseAddress: boolean?",
              "name": "reuseAddress",
              "desc": "Enables `SO_REUSEADDR`."
            },
            {
              "lua_type": "keepAlive: boolean?",
              "name": "keepAlive",
              "desc": "Enables `SO_KEEPALIVE`."
            },
            {
              "lua_type": "nodelay: boolean?",
              "name": "nodelay",
              "desc": "Enables `TCP_NODELAY` for TCP sockets."
            },
            {
              "lua_type": "broadcast: boolean?",
              "name": "broadcast",
              "desc": "Enables `SO_BROADCAST` for UDP broadcast traffic."
            },
            {
              "lua_type": "receiveBufferSize: number?",
              "name": "receiveBufferSize",
              "desc": "Sets `SO_RCVBUF`."
            },
            {
              "lua_type": "sendBufferSize: number?",
              "name": "sendBufferSize",
              "desc": "Sets `SO_SNDBUF`."
            },
            {
              "lua_type": "ipv6Only: boolean?",
              "name": "ipv6Only",
              "desc": "Sets `IPV6_V6ONLY` on IPv6 sockets."
            },
            {
              "lua_type": "localHost: string?",
              "name": "localHost",
              "desc": "Optional local address to bind before connect."
            },
            {
              "lua_type": "localPort: number?",
              "name": "localPort",
              "desc": "Optional local port to bind before connect."
            }
          ],
          "desc": "Options for [[UdpServer.new]].\n"
        }
      ],
      "name": "@eryx/net",
      "tags": [],
      "functions": [],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "High-level TCP and UDP networking helpers built on top of `@eryx/_socket`.\n\nThis module wraps the low-level BSD-style socket API with friendlier\nclient/server classes, socket-option helpers, IPv4/IPv6 family selection,\nand both signal-driven and manual server accept loops.\n\n## Quick start - TCP client\n\n```luau\nlocal net = require(\"@eryx/net\")\n\nlocal client = net.TcpClient.new(\"127.0.0.1\", 8080, {\n\tnodelay = true,\n\ttimeout = 5,\n})\n\nclient:write(\"Hello, server!\")\nlocal response = client:read(1024)\nprint(buffer.tostring(response))\nclient:close()\n```\n\n## Quick start - concurrent TCP server\n\n```luau\nlocal net = require(\"@eryx/net\")\n\nlocal server = net.TcpServer.new(\"0.0.0.0\", 8080, {\n\treuseAddress = true,\n\thandler = function(client)\n\t\tclient:write(\"hello\\\\n\")\n\t\tclient:close()\n\tend,\n})\n```\n\n## Quick start - UDP\n\n```luau\nlocal net = require(\"@eryx/net\")\n\nlocal server = net.UdpServer.new(\"127.0.0.1\", 9000)\nlocal client = net.UdpClient.new(\"127.0.0.1\", 9000)\n\nclient:write(\"ping\")\nlocal data, host, port = server:receive(1024)\nserver:writeTo(\"pong\", host, port)\n\nprint(buffer.tostring(data))\nclient:close()\nserver:close()\n```\n"
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 280
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "socket: _socket.Socket",
          "name": "socket",
          "desc": "Underlying connected socket."
        },
        {
          "tags": [],
          "lua_type": "host: string",
          "name": "host",
          "desc": "Remote host this client is connected to."
        },
        {
          "tags": [],
          "lua_type": "port: number",
          "name": "port",
          "desc": "Remote port this client is connected to."
        },
        {
          "tags": [],
          "lua_type": "family: number",
          "name": "family",
          "desc": "Address family in use, such as `AF_INET` or `AF_INET6`."
        }
      ],
      "desc": "A blocking TCP client wrapper.\n\nAll read and write operations suspend the current coroutine until the\noperation completes or the configured timeout is hit.\n",
      "name": "TcpClient",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 303
          },
          "is_method": false,
          "signature": "TcpClient.new(\n    host: string,  -- Remote hostname or numeric address.\n    port: number,  -- Remote TCP port.\n    options: TcpClientOptions?  -- Optional socket configuration.\n) → (\n    TcpClient  -- A connected blocking TCP client.\n)",
          "owner": "TcpClient",
          "desc": "Creates and connects a blocking TCP client.\n",
          "tags": [],
          "name": "new",
          "return_str": "TcpClient",
          "function_type": "Function",
          "errors": [
            {
              "desc": "Throws if socket creation, optional local bind, or connect fails. "
            }
          ],
          "returns": [
            {
              "lua_type": "TcpClient",
              "desc": "A connected blocking TCP client."
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "host",
              "desc": "Remote hostname or numeric address."
            },
            {
              "lua_type": "number",
              "name": "port",
              "desc": "Remote TCP port."
            },
            {
              "lua_type": "TcpClientOptions?",
              "name": "options",
              "desc": "Optional socket configuration."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 329
          },
          "is_method": false,
          "signature": "TcpClient._fromConnectedSocket(\n    socket: _socket.Socket,  -- Already-connected TCP socket.\n    host: string,  -- Remote peer address.\n    port: number,  -- Remote peer port.\n    family: number?,  -- Address family override.\n    options: TcpClientOptions?  -- Optional wrapper configuration to apply.\n) → (\n    TcpClient  -- Wrapped blocking TCP client. \n)",
          "owner": "TcpClient",
          "desc": "Wraps an already-connected socket as a [[TcpClient]].\n\nThis is primarily used internally by [[TcpServer.accept]], but can also be\nuseful for advanced code that obtains connected sockets elsewhere.\n",
          "tags": [],
          "name": "_fromConnectedSocket",
          "return_str": "TcpClient",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "TcpClient",
              "desc": "Wrapped blocking TCP client. "
            }
          ],
          "params": [
            {
              "lua_type": "_socket.Socket",
              "name": "socket",
              "desc": "Already-connected TCP socket."
            },
            {
              "lua_type": "string",
              "name": "host",
              "desc": "Remote peer address."
            },
            {
              "lua_type": "number",
              "name": "port",
              "desc": "Remote peer port."
            },
            {
              "lua_type": "number?",
              "name": "family",
              "desc": "Address family override."
            },
            {
              "lua_type": "TcpClientOptions?",
              "name": "options",
              "desc": "Optional wrapper configuration to apply."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 351
          },
          "is_method": true,
          "signature": "TcpClient:write(\n    data: string | buffer  -- Payload to send.\n) → ()",
          "owner": "TcpClient",
          "desc": "Sends the provided data to the remote peer.\n\n",
          "tags": [
            "Yields"
          ],
          "name": "write",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string | buffer",
              "name": "data",
              "desc": "Payload to send."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 363
          },
          "is_method": true,
          "signature": "TcpClient:read(\n    bytes: number  -- Maximum number of bytes to receive.\n) → (\n    buffer  -- Received data.\n)",
          "owner": "TcpClient",
          "desc": "Reads up to `bytes` bytes from the remote peer.\n",
          "tags": [
            "Yields"
          ],
          "name": "read",
          "return_str": "buffer",
          "function_type": "Method",
          "errors": [
            {
              "desc": "Throws if the remote side has closed the connection. "
            }
          ],
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Received data."
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "bytes",
              "desc": "Maximum number of bytes to receive."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 378
          },
          "is_method": true,
          "signature": "TcpClient:setTimeout(\n    seconds: number?  -- Timeout in seconds, or `nil` for no timeout. \n) → ()",
          "owner": "TcpClient",
          "desc": "Updates the blocking timeout for future operations on this client.\n\nPassing `nil` restores blocking mode with no timeout.\n",
          "tags": [],
          "name": "setTimeout",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number?",
              "name": "seconds",
              "desc": "Timeout in seconds, or `nil` for no timeout. "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 389
          },
          "is_method": true,
          "signature": "TcpClient:setSocketOption(\n    level: number,  -- Protocol level such as `SOL_SOCKET`.\n    option: number,  -- Option constant such as `SO_KEEPALIVE`.\n    value: number | boolean  -- Value to set. \n) → ()",
          "owner": "TcpClient",
          "desc": "Sets a socket option on the underlying connection.\n",
          "tags": [],
          "name": "setSocketOption",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number",
              "name": "level",
              "desc": "Protocol level such as `SOL_SOCKET`."
            },
            {
              "lua_type": "number",
              "name": "option",
              "desc": "Option constant such as `SO_KEEPALIVE`."
            },
            {
              "lua_type": "number | boolean",
              "name": "value",
              "desc": "Value to set. "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 400
          },
          "is_method": true,
          "signature": "TcpClient:getSocketOption(\n    level: number,  -- Protocol level such as `SOL_SOCKET`.\n    option: number  -- Option constant to query.\n) → (\n    number  -- Current option value. \n)",
          "owner": "TcpClient",
          "desc": "Reads a socket option from the underlying connection.\n",
          "tags": [],
          "name": "getSocketOption",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": "Current option value. "
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "level",
              "desc": "Protocol level such as `SOL_SOCKET`."
            },
            {
              "lua_type": "number",
              "name": "option",
              "desc": "Option constant to query."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 410
          },
          "is_method": true,
          "signature": "TcpClient:getPeerName() → (\n    string,  -- Remote host.\n    number  -- Remote port. \n)",
          "owner": "TcpClient",
          "desc": "Returns the remote address and port of this connection.\n",
          "tags": [],
          "name": "getPeerName",
          "return_str": "(string, number)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Remote host."
            },
            {
              "lua_type": "number",
              "desc": "Remote port. "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 420
          },
          "is_method": true,
          "signature": "TcpClient:getSockName() → (\n    string,  -- Local host.\n    number  -- Local port. \n)",
          "owner": "TcpClient",
          "desc": "Returns the local address and port used by this connection.\n",
          "tags": [],
          "name": "getSockName",
          "return_str": "(string, number)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Local host."
            },
            {
              "lua_type": "number",
              "desc": "Local port. "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 429
          },
          "is_method": true,
          "signature": "TcpClient:shutdown(\n    how: number  -- One of `_socket.SHUT_RD`, `_socket.SHUT_WR`, or `_socket.SHUT_RDWR`. \n) → ()",
          "owner": "TcpClient",
          "desc": "Shuts down one or both halves of the TCP connection.\n",
          "tags": [],
          "name": "shutdown",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number",
              "name": "how",
              "desc": "One of `_socket.SHUT_RD`, `_socket.SHUT_WR`, or `_socket.SHUT_RDWR`. "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 436
          },
          "is_method": true,
          "signature": "TcpClient:close() → ()",
          "owner": "TcpClient",
          "desc": "Closes the TCP connection.\n",
          "tags": [],
          "name": "close",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 448
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "socket: _socket.Socket",
          "name": "socket",
          "desc": "Underlying connected socket."
        },
        {
          "tags": [],
          "lua_type": "host: string",
          "name": "host",
          "desc": "Remote host this client is connected to."
        },
        {
          "tags": [],
          "lua_type": "port: number",
          "name": "port",
          "desc": "Remote port this client is connected to."
        },
        {
          "tags": [],
          "lua_type": "family: number",
          "name": "family",
          "desc": "Address family in use, such as `AF_INET` or `AF_INET6`."
        }
      ],
      "desc": "A non-blocking TCP client wrapper.\n\nRead operations return `nil` when no data is available yet, and write\noperations return `false` when the socket would block.\n",
      "name": "TcpClientNonBlocking",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 471
          },
          "is_method": false,
          "signature": "TcpClientNonBlocking.new(\n    host: string,  -- Remote hostname or numeric address.\n    port: number,  -- Remote TCP port.\n    options: TcpClientOptions?  -- Optional socket configuration.\n) → (\n    TcpClientNonBlocking  -- A connected non-blocking TCP client.\n)",
          "owner": "TcpClientNonBlocking",
          "desc": "Creates and connects a non-blocking TCP client.\n",
          "tags": [],
          "name": "new",
          "return_str": "TcpClientNonBlocking",
          "function_type": "Function",
          "errors": [
            {
              "desc": "Throws if socket creation, optional local bind, or connect fails. "
            }
          ],
          "returns": [
            {
              "lua_type": "TcpClientNonBlocking",
              "desc": "A connected non-blocking TCP client."
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "host",
              "desc": "Remote hostname or numeric address."
            },
            {
              "lua_type": "number",
              "name": "port",
              "desc": "Remote TCP port."
            },
            {
              "lua_type": "TcpClientOptions?",
              "name": "options",
              "desc": "Optional socket configuration."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 496
          },
          "is_method": false,
          "signature": "TcpClientNonBlocking._fromConnectedSocket(\n    socket: _socket.Socket,  -- Already-connected TCP socket.\n    host: string,  -- Remote peer address.\n    port: number,  -- Remote peer port.\n    family: number?,  -- Address family override.\n    options: TcpClientOptions?  -- Optional wrapper configuration to apply.\n) → (\n    TcpClientNonBlocking  -- Wrapped non-blocking TCP client. \n)",
          "owner": "TcpClientNonBlocking",
          "desc": "Wraps an already-connected socket as a [[TcpClientNonBlocking]].\n",
          "tags": [],
          "name": "_fromConnectedSocket",
          "return_str": "TcpClientNonBlocking",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "TcpClientNonBlocking",
              "desc": "Wrapped non-blocking TCP client. "
            }
          ],
          "params": [
            {
              "lua_type": "_socket.Socket",
              "name": "socket",
              "desc": "Already-connected TCP socket."
            },
            {
              "lua_type": "string",
              "name": "host",
              "desc": "Remote peer address."
            },
            {
              "lua_type": "number",
              "name": "port",
              "desc": "Remote peer port."
            },
            {
              "lua_type": "number?",
              "name": "family",
              "desc": "Address family override."
            },
            {
              "lua_type": "TcpClientOptions?",
              "name": "options",
              "desc": "Optional wrapper configuration to apply."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 520
          },
          "is_method": true,
          "signature": "TcpClientNonBlocking:write(\n    data: string | buffer  -- Payload to send.\n) → (\n    boolean  -- `true` when the payload was fully sent, `false` when the socket would block. \n)",
          "owner": "TcpClientNonBlocking",
          "desc": "Attempts to send the full payload without blocking.\n",
          "tags": [],
          "name": "write",
          "return_str": "boolean",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": "`true` when the payload was fully sent, `false` when the socket would block. "
            }
          ],
          "params": [
            {
              "lua_type": "string | buffer",
              "name": "data",
              "desc": "Payload to send."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 531
          },
          "is_method": true,
          "signature": "TcpClientNonBlocking:read(\n    bytes: number  -- Maximum number of bytes to receive.\n) → (\n    buffer?  -- Received data, or `nil` if the socket would block.\n)",
          "owner": "TcpClientNonBlocking",
          "desc": "Attempts to read up to `bytes` bytes without blocking.\n",
          "tags": [],
          "name": "read",
          "return_str": "buffer?",
          "function_type": "Method",
          "errors": [
            {
              "desc": "Throws if the remote side has closed the connection. "
            }
          ],
          "returns": [
            {
              "lua_type": "buffer?",
              "desc": "Received data, or `nil` if the socket would block."
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "bytes",
              "desc": "Maximum number of bytes to receive."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 546
          },
          "is_method": true,
          "signature": "TcpClientNonBlocking:setSocketOption(\n    level: number,  -- Protocol level such as `SOL_SOCKET`.\n    option: number,  -- Option constant such as `SO_KEEPALIVE`.\n    value: number | boolean  -- Value to set. \n) → ()",
          "owner": "TcpClientNonBlocking",
          "desc": "Sets a socket option on the underlying connection.\n",
          "tags": [],
          "name": "setSocketOption",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number",
              "name": "level",
              "desc": "Protocol level such as `SOL_SOCKET`."
            },
            {
              "lua_type": "number",
              "name": "option",
              "desc": "Option constant such as `SO_KEEPALIVE`."
            },
            {
              "lua_type": "number | boolean",
              "name": "value",
              "desc": "Value to set. "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 562
          },
          "is_method": true,
          "signature": "TcpClientNonBlocking:getSocketOption(\n    level: number,  -- Protocol level such as `SOL_SOCKET`.\n    option: number  -- Option constant to query.\n) → (\n    number  -- Current option value. \n)",
          "owner": "TcpClientNonBlocking",
          "desc": "Reads a socket option from the underlying connection.\n",
          "tags": [],
          "name": "getSocketOption",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": "Current option value. "
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "level",
              "desc": "Protocol level such as `SOL_SOCKET`."
            },
            {
              "lua_type": "number",
              "name": "option",
              "desc": "Option constant to query."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 572
          },
          "is_method": true,
          "signature": "TcpClientNonBlocking:getPeerName() → (\n    string,  -- Remote host.\n    number  -- Remote port. \n)",
          "owner": "TcpClientNonBlocking",
          "desc": "Returns the remote address and port of this connection.\n",
          "tags": [],
          "name": "getPeerName",
          "return_str": "(string, number)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Remote host."
            },
            {
              "lua_type": "number",
              "desc": "Remote port. "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 582
          },
          "is_method": true,
          "signature": "TcpClientNonBlocking:getSockName() → (\n    string,  -- Local host.\n    number  -- Local port. \n)",
          "owner": "TcpClientNonBlocking",
          "desc": "Returns the local address and port used by this connection.\n",
          "tags": [],
          "name": "getSockName",
          "return_str": "(string, number)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Local host."
            },
            {
              "lua_type": "number",
              "desc": "Local port. "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 591
          },
          "is_method": true,
          "signature": "TcpClientNonBlocking:shutdown(\n    how: number  -- One of `_socket.SHUT_RD`, `_socket.SHUT_WR`, or `_socket.SHUT_RDWR`. \n) → ()",
          "owner": "TcpClientNonBlocking",
          "desc": "Shuts down one or both halves of the TCP connection.\n",
          "tags": [],
          "name": "shutdown",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number",
              "name": "how",
              "desc": "One of `_socket.SHUT_RD`, `_socket.SHUT_WR`, or `_socket.SHUT_RDWR`. "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 598
          },
          "is_method": true,
          "signature": "TcpClientNonBlocking:close() → ()",
          "owner": "TcpClientNonBlocking",
          "desc": "Closes the TCP connection.\n",
          "tags": [],
          "name": "close",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 628
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "socket: _socket.Socket",
          "name": "socket",
          "desc": "Underlying listening socket."
        },
        {
          "tags": [],
          "lua_type": "onClient: Signal.Signal<TcpClient>",
          "name": "onClient",
          "desc": "Fired for each accepted client in `signal` mode."
        },
        {
          "tags": [],
          "lua_type": "onError: Signal.Signal<any>",
          "name": "onError",
          "desc": "Fired when the background accept loop encounters an error."
        },
        {
          "tags": [],
          "lua_type": "host: string",
          "name": "host",
          "desc": "Bound local host."
        },
        {
          "tags": [],
          "lua_type": "port: number",
          "name": "port",
          "desc": "Bound local port."
        },
        {
          "tags": [],
          "lua_type": "family: number",
          "name": "family",
          "desc": "Address family in use, such as `AF_INET` or `AF_INET6`."
        },
        {
          "tags": [],
          "lua_type": "_listening: boolean",
          "name": "_listening",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "_mode: \"signal\" | \"manual\"",
          "name": "_mode",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "_clientOptions: TcpClientOptions?",
          "name": "_clientOptions",
          "desc": ""
        }
      ],
      "desc": "A TCP server wrapper.\n\nIn `signal` mode, a background accept loop dispatches each connection\nthrough [[TcpServer.onClient]]. In `manual` mode, callers explicitly use\n[[TcpServer.accept]] or [[TcpServer.acceptNonBlocking]].\n",
      "name": "TcpServer",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 675
          },
          "is_method": false,
          "signature": "TcpServer.new(\n    host: string,  -- Local address to bind to.\n    port: number,  -- Local port to listen on. Use `0` to let the OS choose.\n    options: TcpServerOptions?  -- Optional listener configuration.\n) → (\n    TcpServer  -- A listening TCP server.\n)",
          "owner": "TcpServer",
          "desc": "Creates and starts a TCP server.\n\nWhen `options.mode` is `\"signal\"` or omitted, the server immediately starts\na background accept loop. When set to `\"manual\"`, no background loop is\nstarted and callers should use [[TcpServer.accept]] themselves.\n",
          "tags": [],
          "name": "new",
          "return_str": "TcpServer",
          "function_type": "Function",
          "errors": [
            {
              "desc": "Throws if socket creation, bind, or listen fails. "
            }
          ],
          "returns": [
            {
              "lua_type": "TcpServer",
              "desc": "A listening TCP server."
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "host",
              "desc": "Local address to bind to."
            },
            {
              "lua_type": "number",
              "name": "port",
              "desc": "Local port to listen on. Use `0` to let the OS choose."
            },
            {
              "lua_type": "TcpServerOptions?",
              "name": "options",
              "desc": "Optional listener configuration."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 720
          },
          "is_method": true,
          "signature": "TcpServer:accept() → (\n    TcpClient?  -- Accepted client, or `nil` when the listening socket is non-blocking and no client is ready.\n)",
          "owner": "TcpServer",
          "desc": "Accepts the next incoming connection as a blocking [[TcpClient]].\n\nIn `manual` mode this is typically called by user code. In `signal` mode it\nis used internally by the background accept loop.\n\n",
          "tags": [
            "Yields"
          ],
          "name": "accept",
          "return_str": "TcpClient?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "TcpClient?",
              "desc": "Accepted client, or `nil` when the listening socket is non-blocking and no client is ready."
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 734
          },
          "is_method": true,
          "signature": "TcpServer:acceptNonBlocking() → (\n    TcpClientNonBlocking?  -- Accepted client, or `nil` when the listening socket is non-blocking and no client is ready.\n)",
          "owner": "TcpServer",
          "desc": "Accepts the next incoming connection as a non-blocking [[TcpClientNonBlocking]].\n\n",
          "tags": [
            "Yields"
          ],
          "name": "acceptNonBlocking",
          "return_str": "TcpClientNonBlocking?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "TcpClientNonBlocking?",
              "desc": "Accepted client, or `nil` when the listening socket is non-blocking and no client is ready."
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 748
          },
          "is_method": true,
          "signature": "TcpServer:handle(\n    handler: ((client: TcpClient) → ())  -- Callback to run for each accepted client.\n) → (\n    Signal.Connection<TcpClient>  -- Connection object that can disconnect the handler. \n)",
          "owner": "TcpServer",
          "desc": "Registers a handler on [[TcpServer.onClient]].\n",
          "tags": [],
          "name": "handle",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "((client: TcpClient) → ())",
              "name": "handler",
              "desc": "Callback to run for each accepted client."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 758
          },
          "is_method": true,
          "signature": "TcpServer:getSockName() → (\n    string,  -- Local host.\n    number  -- Local port. \n)",
          "owner": "TcpServer",
          "desc": "Returns the bound local address and port of the listening socket.\n",
          "tags": [],
          "name": "getSockName",
          "return_str": "(string, number)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Local host."
            },
            {
              "lua_type": "number",
              "desc": "Local port. "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 765
          },
          "is_method": true,
          "signature": "TcpServer:stopListening() → ()",
          "owner": "TcpServer",
          "desc": "Stops accepting new connections and closes the listening socket.\n",
          "tags": [],
          "name": "stopListening",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 780
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "socket: _socket.Socket",
          "name": "socket",
          "desc": "Underlying UDP socket."
        },
        {
          "tags": [],
          "lua_type": "host: string",
          "name": "host",
          "desc": "Default remote host."
        },
        {
          "tags": [],
          "lua_type": "port: number",
          "name": "port",
          "desc": "Default remote port."
        },
        {
          "tags": [],
          "lua_type": "family: number",
          "name": "family",
          "desc": "Address family in use, such as `AF_INET` or `AF_INET6`."
        }
      ],
      "desc": "A UDP client wrapper.\n\nUnlike TCP, UDP is datagram-oriented: each send corresponds to one packet\nand reads may return complete datagrams from a connected peer.\n",
      "name": "UdpClient",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 806
          },
          "is_method": false,
          "signature": "UdpClient.new(\n    host: string,  -- Default remote hostname or numeric address.\n    port: number,  -- Default remote UDP port.\n    options: UdpClientOptions?  -- Optional socket configuration.\n) → (\n    UdpClient  -- Connected UDP client wrapper.\n)",
          "owner": "UdpClient",
          "desc": "Creates a UDP socket and connects it to a default remote peer.\n\nConnected UDP sockets can still use [[UdpClient.writeTo]] to override the\ndestination per datagram.\n",
          "tags": [],
          "name": "new",
          "return_str": "UdpClient",
          "function_type": "Function",
          "errors": [
            {
              "desc": "Throws if socket creation, optional local bind, or connect fails. "
            }
          ],
          "returns": [
            {
              "lua_type": "UdpClient",
              "desc": "Connected UDP client wrapper."
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "host",
              "desc": "Default remote hostname or numeric address."
            },
            {
              "lua_type": "number",
              "name": "port",
              "desc": "Default remote UDP port."
            },
            {
              "lua_type": "UdpClientOptions?",
              "name": "options",
              "desc": "Optional socket configuration."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 826
          },
          "is_method": true,
          "signature": "UdpClient:write(\n    data: string | buffer  -- Datagram payload.\n) → (\n    number?  -- Number of bytes written, or `nil` if the socket would block.\n)",
          "owner": "UdpClient",
          "desc": "Sends one datagram to the connected peer.\n\n",
          "tags": [
            "Yields"
          ],
          "name": "write",
          "return_str": "number?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number?",
              "desc": "Number of bytes written, or `nil` if the socket would block."
            }
          ],
          "params": [
            {
              "lua_type": "string | buffer",
              "name": "data",
              "desc": "Datagram payload."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 839
          },
          "is_method": true,
          "signature": "UdpClient:writeTo(\n    data: string | buffer,  -- Datagram payload.\n    host: string,  -- Destination host.\n    port: number  -- Destination port.\n) → (\n    number?  -- Number of bytes written, or `nil` if the socket would block.\n)",
          "owner": "UdpClient",
          "desc": "Sends one datagram to an explicit destination.\n\n",
          "tags": [
            "Yields"
          ],
          "name": "writeTo",
          "return_str": "number?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number?",
              "desc": "Number of bytes written, or `nil` if the socket would block."
            }
          ],
          "params": [
            {
              "lua_type": "string | buffer",
              "name": "data",
              "desc": "Datagram payload."
            },
            {
              "lua_type": "string",
              "name": "host",
              "desc": "Destination host."
            },
            {
              "lua_type": "number",
              "name": "port",
              "desc": "Destination port."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 850
          },
          "is_method": true,
          "signature": "UdpClient:read(\n    bytes: number  -- Maximum datagram size to receive.\n) → (\n    buffer?  -- Datagram payload, or `nil` if the socket would block.\n)",
          "owner": "UdpClient",
          "desc": "Receives one datagram payload from the connected peer.\n\n",
          "tags": [
            "Yields"
          ],
          "name": "read",
          "return_str": "buffer?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "buffer?",
              "desc": "Datagram payload, or `nil` if the socket would block."
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "bytes",
              "desc": "Maximum datagram size to receive."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 863
          },
          "is_method": true,
          "signature": "UdpClient:readFrom(\n    bytes: number  -- Maximum datagram size to receive.\n) → (\n    buffer?,  -- Datagram payload.\n    string?,  -- Sender host.\n    number?  -- Sender port.\n)",
          "owner": "UdpClient",
          "desc": "Receives one datagram along with its sender address.\n\n",
          "tags": [
            "Yields"
          ],
          "name": "readFrom",
          "return_str": "(buffer?, string?, number?)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "buffer?",
              "desc": "Datagram payload."
            },
            {
              "lua_type": "string?",
              "desc": "Sender host."
            },
            {
              "lua_type": "number?",
              "desc": "Sender port."
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "bytes",
              "desc": "Maximum datagram size to receive."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 874
          },
          "is_method": true,
          "signature": "UdpClient:setTimeout(\n    seconds: number?  -- Timeout in seconds, or `nil` for no timeout. \n) → ()",
          "owner": "UdpClient",
          "desc": "Updates the blocking timeout for future operations on this client.\n\nPassing `nil` restores blocking mode with no timeout.\n",
          "tags": [],
          "name": "setTimeout",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number?",
              "name": "seconds",
              "desc": "Timeout in seconds, or `nil` for no timeout. "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 885
          },
          "is_method": true,
          "signature": "UdpClient:setSocketOption(\n    level: number,  -- Protocol level such as `SOL_SOCKET`.\n    option: number,  -- Option constant such as `SO_BROADCAST`.\n    value: number | boolean  -- Value to set. \n) → ()",
          "owner": "UdpClient",
          "desc": "Sets a socket option on the underlying UDP socket.\n",
          "tags": [],
          "name": "setSocketOption",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number",
              "name": "level",
              "desc": "Protocol level such as `SOL_SOCKET`."
            },
            {
              "lua_type": "number",
              "name": "option",
              "desc": "Option constant such as `SO_BROADCAST`."
            },
            {
              "lua_type": "number | boolean",
              "name": "value",
              "desc": "Value to set. "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 896
          },
          "is_method": true,
          "signature": "UdpClient:getSocketOption(\n    level: number,  -- Protocol level such as `SOL_SOCKET`.\n    option: number  -- Option constant to query.\n) → (\n    number  -- Current option value. \n)",
          "owner": "UdpClient",
          "desc": "Reads a socket option from the underlying UDP socket.\n",
          "tags": [],
          "name": "getSocketOption",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": "Current option value. "
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "level",
              "desc": "Protocol level such as `SOL_SOCKET`."
            },
            {
              "lua_type": "number",
              "name": "option",
              "desc": "Option constant to query."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 906
          },
          "is_method": true,
          "signature": "UdpClient:getPeerName() → (\n    string,  -- Remote host.\n    number  -- Remote port. \n)",
          "owner": "UdpClient",
          "desc": "Returns the default remote peer for this connected UDP socket.\n",
          "tags": [],
          "name": "getPeerName",
          "return_str": "(string, number)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Remote host."
            },
            {
              "lua_type": "number",
              "desc": "Remote port. "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 916
          },
          "is_method": true,
          "signature": "UdpClient:getSockName() → (\n    string,  -- Local host.\n    number  -- Local port. \n)",
          "owner": "UdpClient",
          "desc": "Returns the local address and port used by this UDP socket.\n",
          "tags": [],
          "name": "getSockName",
          "return_str": "(string, number)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Local host."
            },
            {
              "lua_type": "number",
              "desc": "Local port. "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 923
          },
          "is_method": true,
          "signature": "UdpClient:close() → ()",
          "owner": "UdpClient",
          "desc": "Closes the UDP socket.\n",
          "tags": [],
          "name": "close",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 953
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "socket: _socket.Socket",
          "name": "socket",
          "desc": "Underlying bound UDP socket."
        },
        {
          "tags": [],
          "lua_type": "onDatagram: Signal.Signal<buffer, string, number>",
          "name": "onDatagram",
          "desc": "Fired with `(data, host, port)` for each received datagram in `signal` mode."
        },
        {
          "tags": [],
          "lua_type": "onError: Signal.Signal<any>",
          "name": "onError",
          "desc": "Fired when the background receive loop encounters an error."
        },
        {
          "tags": [],
          "lua_type": "host: string",
          "name": "host",
          "desc": "Bound local host."
        },
        {
          "tags": [],
          "lua_type": "port: number",
          "name": "port",
          "desc": "Bound local port."
        },
        {
          "tags": [],
          "lua_type": "family: number",
          "name": "family",
          "desc": "Address family in use, such as `AF_INET` or `AF_INET6`."
        },
        {
          "tags": [],
          "lua_type": "_listening: boolean",
          "name": "_listening",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "_mode: \"signal\" | \"manual\"",
          "name": "_mode",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "_packetSize: number",
          "name": "_packetSize",
          "desc": ""
        }
      ],
      "desc": "A UDP server wrapper.\n\nIn `signal` mode, a background receive loop dispatches datagrams through\n[[UdpServer.onDatagram]]. In `manual` mode, callers explicitly use\n[[UdpServer.receive]].\n",
      "name": "UdpServer",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 996
          },
          "is_method": false,
          "signature": "UdpServer.new(\n    host: string,  -- Local address to bind to.\n    port: number,  -- Local UDP port. Use `0` to let the OS choose.\n    options: UdpServerOptions?  -- Optional socket configuration.\n) → (\n    UdpServer  -- Bound UDP server wrapper.\n)",
          "owner": "UdpServer",
          "desc": "Creates and binds a UDP server socket.\n\nWhen `options.mode` is `\"signal\"`, the server immediately starts a\nbackground receive loop that fires [[UdpServer.onDatagram]].\n",
          "tags": [],
          "name": "new",
          "return_str": "UdpServer",
          "function_type": "Function",
          "errors": [
            {
              "desc": "Throws if socket creation or bind fails. "
            }
          ],
          "returns": [
            {
              "lua_type": "UdpServer",
              "desc": "Bound UDP server wrapper."
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "host",
              "desc": "Local address to bind to."
            },
            {
              "lua_type": "number",
              "name": "port",
              "desc": "Local UDP port. Use `0` to let the OS choose."
            },
            {
              "lua_type": "UdpServerOptions?",
              "name": "options",
              "desc": "Optional socket configuration."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 1034
          },
          "is_method": true,
          "signature": "UdpServer:receive(\n    bytes: number  -- Maximum datagram size to receive.\n) → (\n    buffer?,  -- Datagram payload.\n    string?,  -- Sender host.\n    number?  -- Sender port.\n)",
          "owner": "UdpServer",
          "desc": "Receives one datagram and its sender address.\n\n",
          "tags": [
            "Yields"
          ],
          "name": "receive",
          "return_str": "(buffer?, string?, number?)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "buffer?",
              "desc": "Datagram payload."
            },
            {
              "lua_type": "string?",
              "desc": "Sender host."
            },
            {
              "lua_type": "number?",
              "desc": "Sender port."
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "bytes",
              "desc": "Maximum datagram size to receive."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 1047
          },
          "is_method": true,
          "signature": "UdpServer:writeTo(\n    data: string | buffer,  -- Datagram payload.\n    host: string,  -- Destination host.\n    port: number  -- Destination port.\n) → (\n    number?  -- Number of bytes written, or `nil` if the socket would block.\n)",
          "owner": "UdpServer",
          "desc": "Sends one datagram to the specified destination.\n\n",
          "tags": [
            "Yields"
          ],
          "name": "writeTo",
          "return_str": "number?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number?",
              "desc": "Number of bytes written, or `nil` if the socket would block."
            }
          ],
          "params": [
            {
              "lua_type": "string | buffer",
              "name": "data",
              "desc": "Datagram payload."
            },
            {
              "lua_type": "string",
              "name": "host",
              "desc": "Destination host."
            },
            {
              "lua_type": "number",
              "name": "port",
              "desc": "Destination port."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 1058
          },
          "is_method": true,
          "signature": "UdpServer:setTimeout(\n    seconds: number?  -- Timeout in seconds, or `nil` for no timeout. \n) → ()",
          "owner": "UdpServer",
          "desc": "Updates the blocking timeout for future operations on this server socket.\n\nPassing `nil` restores blocking mode with no timeout.\n",
          "tags": [],
          "name": "setTimeout",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number?",
              "name": "seconds",
              "desc": "Timeout in seconds, or `nil` for no timeout. "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 1069
          },
          "is_method": true,
          "signature": "UdpServer:setSocketOption(\n    level: number,  -- Protocol level such as `SOL_SOCKET`.\n    option: number,  -- Option constant such as `SO_BROADCAST`.\n    value: number | boolean  -- Value to set. \n) → ()",
          "owner": "UdpServer",
          "desc": "Sets a socket option on the underlying UDP socket.\n",
          "tags": [],
          "name": "setSocketOption",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number",
              "name": "level",
              "desc": "Protocol level such as `SOL_SOCKET`."
            },
            {
              "lua_type": "number",
              "name": "option",
              "desc": "Option constant such as `SO_BROADCAST`."
            },
            {
              "lua_type": "number | boolean",
              "name": "value",
              "desc": "Value to set. "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 1080
          },
          "is_method": true,
          "signature": "UdpServer:getSocketOption(\n    level: number,  -- Protocol level such as `SOL_SOCKET`.\n    option: number  -- Option constant to query.\n) → (\n    number  -- Current option value. \n)",
          "owner": "UdpServer",
          "desc": "Reads a socket option from the underlying UDP socket.\n",
          "tags": [],
          "name": "getSocketOption",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": "Current option value. "
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "level",
              "desc": "Protocol level such as `SOL_SOCKET`."
            },
            {
              "lua_type": "number",
              "name": "option",
              "desc": "Option constant to query."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 1090
          },
          "is_method": true,
          "signature": "UdpServer:getSockName() → (\n    string,  -- Local host.\n    number  -- Local port. \n)",
          "owner": "UdpServer",
          "desc": "Returns the local address and port of the bound UDP socket.\n",
          "tags": [],
          "name": "getSockName",
          "return_str": "(string, number)",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Local host."
            },
            {
              "lua_type": "number",
              "desc": "Local port. "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 1097
          },
          "is_method": true,
          "signature": "UdpServer:stopListening() → ()",
          "owner": "UdpServer",
          "desc": "Stops the background receive loop, if any, and closes the UDP socket.\n",
          "tags": [],
          "name": "stopListening",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    }
  ]
}