19.10.2017, 09:03
Hi Admin,
A couple of questions,
Will this server support multiple clients? I added a basic authentication, that just sets a global variable on connecting and closes the connection if the password is incorrect.
The data received is passed another function parseC. Now I need to be able to respond back to the connected client where I declared a global function in this handler. Is this the right way to do this?
Thanks,
Roger
A couple of questions,
Will this server support multiple clients? I added a basic authentication, that just sets a global variable on connecting and closes the connection if the password is incorrect.
The data received is passed another function parseC. Now I need to be able to respond back to the connected client where I declared a global function in this handler. Is this the right way to do this?
Code:
-- handle data frame
if data then
if(first==true)then
if(data ~='mypassword')then
first=false
sock:close()
end
end
Sclient= function (param)
sock:send(param)
end
local fd,prtd = pcall(parseC,data)
if(fd==false)then
alert("[elk-client] Error with parsemsg %s ",prtd)
end
end
Thanks,
Roger