local has_ponged = false local socket = net.newsocket(net.PAIR) socket:bind("tcp://127.0.0.1:5555") function socket:receive(stream) print("Socket receive triggered") has_ponged = true local message = stream:readstring() assert(message == "ping") socket:send(function(stream2) stream2:writestring("pong") end) end function GAME.tick() if has_ponged then GAME.exit() end end GAME.exit()