Code: Select all
local zmq = require "lzmq"
local context = zmq.init(1)
local sender = context:socket(zmq.PUSH)
c=0
function love.load(arg)
r = sender:connect("tcp://192.168.1.10:8830")
end
function love.quit()
sender:close()
end
function love.draw()
c = c + 1
str = string.format("test : %i",c)
love.graphics.print(str, 50, 50)
end
function love.update(dt)
if love.mouse.isDown("l") then
x, y = love.mouse.getPosition()
sender:send(tostring(x)..","..tostring(y))
end
end
when I click mouse left button, it push x,y to another zeromq pull server, if the server is up before i click, it works perfectly.
but....
if the server isn't up, and I clicked, love2d program keep updating the frame counter, and if I want the close love2d, if stopped updating.... and can't be closed until I start the server pull program.
I think we can not expect the pull server always be there, if not , how can I close the frozen love2d?
thanks in advanced.