From ef294f207c5b84fd91dbcc9cf77ff21d90d8a1cb Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Thu, 17 Oct 2024 11:27:32 +0200 Subject: [PATCH] Fix websocket example files --- .lune/websocket_client.luau | 6 +++--- .lune/websocket_server.luau | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.lune/websocket_client.luau b/.lune/websocket_client.luau index 8b394a7..d9cf6b2 100644 --- a/.lune/websocket_client.luau +++ b/.lune/websocket_client.luau @@ -28,8 +28,8 @@ end) for _ = 1, 5 do local start = os.clock() - socket.send(tostring(1)) - local response = socket.next() + socket:send(tostring(1)) + local response = socket:next() local elapsed = os.clock() - start print(`Got response '{response}' in {elapsed * 1_000} milliseconds`) task.wait(1 - elapsed) @@ -38,7 +38,7 @@ end -- Everything went well, and we are done with the socket, so we can close it print("Closing web socket...") -socket.close() +socket:close() task.cancel(forceExit) print("Done! 🌙") diff --git a/.lune/websocket_server.luau b/.lune/websocket_server.luau index 773d0be..c6f620d 100644 --- a/.lune/websocket_server.luau +++ b/.lune/websocket_server.luau @@ -15,9 +15,9 @@ local handle = net.serve(PORT, { handleWebSocket = function(socket) print("Got new web socket connection!") repeat - local message = socket.next() + local message = socket:next() if message ~= nil then - socket.send("Echo - " .. message) + socket:send("Echo - " .. message) end until message == nil print("Web socket disconnected.")