socket.IsClosed
True once the socket has closed.
Syntax
socket.IsClosed
Parameters
This function takes no parameters.
Returns
| Type | Description |
|---|---|
boolean | The boolean result of the check. |
Description
socket.IsClosed is part of the WebSocket library. WebSocket helpers manage a client connection: opening, sending, polling and closing, with message callbacks.
The call is a predicate: it inspects the current state and returns a boolean without modifying anything.
The aliases socket.isClosed resolve to the same implementation.
Example
local ws = WebSocket.open("wss://echo.websocket.events")
print(ws.IsClosed)
Notes
- Aliases:
socket.isClosed. - Keep message callbacks short; they run on the module's networking thread.