Skip to main content

Connection

Stores a callback that will be called by YetAnotherNet at the end of a frame if Connection.connected is true.

You can disconnect the connection by using Connection:disconnect and reconnect by using Connection:reconnect.

For more information, see YetAnotherNet.createConnection.

Properties

connected

Connection.connected: boolean

Functions

new

Connection.new(callback(U...) → ()) → ()

disconnect

Connection:disconnect() → ()

reconnect

Connection:reconnect() → ()
Show raw api
{
    "functions": [
        {
            "name": "disconnect",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 33,
                "path": "lib/Connection.luau"
            }
        },
        {
            "name": "reconnect",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 40,
                "path": "lib/Connection.luau"
            }
        },
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "(U...) -> ()"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "lib/Connection.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "connected",
            "desc": "",
            "lua_type": "boolean",
            "source": {
                "line": 31,
                "path": "lib/Connection.luau"
            }
        }
    ],
    "types": [],
    "name": "Connection",
    "desc": "Stores a callback that will be called by YetAnotherNet at the end of a frame\nif [Connection.connected] is true.\n\nYou can disconnect the connection by using [Connection:disconnect] and\nreconnect by using [Connection:reconnect].\n\nFor more information, see [YetAnotherNet.createConnection].",
    "source": {
        "line": 26,
        "path": "lib/Connection.luau"
    }
}