mirror of
https://github.com/defold/extension-websocket.git
synced 2025-09-27 07:52:18 +02:00
Issue 8: Handle the websocket close event
This commit is contained in:
@@ -20,10 +20,13 @@ local function websocket_callback(self, conn, data)
|
||||
print("Connected " .. conn)
|
||||
-- self.connection = conn
|
||||
elseif data.event == websocket.EVENT_ERROR then
|
||||
print("Error:", data.error)
|
||||
print("Error:", data.message)
|
||||
elseif data.event == websocket.EVENT_MESSAGE then
|
||||
print("Receiving: '" .. tostring(data.message) .. "'")
|
||||
end
|
||||
elseif data.event == websocket.EVENT_DISCONNECTED then
|
||||
print("Disconnected: '" .. tostring(data.message) .. "'")
|
||||
end
|
||||
end
|
||||
|
||||
function init(self)
|
||||
|
Reference in New Issue
Block a user