local socket = require("socket")

local function has_value(tab, value)
    for i, v in ipairs(tab) do
        if v == value then return i end
    end
    return false
end

local function checkOn(client)
   local line, err = client:receive()
	if line then
		client:send(line .. "\n")
	end
	if err and err ~= "timeout" then
		print(tostring(client) .. " " .. err)
		client:close()
		return true