websocket.close
Closes this websocket handle. You should always do this after finishing using a websocket, in order to free up resources.
|
|||
Opens a websocket and then immediately closes it. | |||
Code | <nowiki>
local ws, err = http.websocket("wss://echo.websocket.org")
if ws then
-- Probably should do something interesting with the websocket before
ws.close()
end
</nowiki>
|
Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Lua |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CC:Tweaked |
|
websocket.close Function | |
---|---|
Syntax websocket.close() | |
API | http |
Source | CC:Tweaked (source) |
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.