diff options
Diffstat (limited to 'src/modules/tcp_listen.lua')
-rw-r--r-- | src/modules/tcp_listen.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/tcp_listen.lua b/src/modules/tcp_listen.lua index 365e116..09f3400 100644 --- a/src/modules/tcp_listen.lua +++ b/src/modules/tcp_listen.lua @@ -1,15 +1,15 @@ -- -- gcsd -- --- gcsd the generic command sequencer daemon can be used to serialize +-- gcsd the generic command sequencer daemon can be used to serialize -- commands sent over various paralell communication channels to a -- single command output. It can be seen as a multiplexer for any -- kind of communication between a single resource and various clients -- which want to submit commands to it or query information from it. --- gcsd is written in C and Lua. The goal is to provide an easy to +-- gcsd is written in C and Lua. The goal is to provide an easy to -- understand high level API based on Lua which can be used to -- implement the business logic of the so formed multiplexer daemon. --- +-- -- -- Copyright (C) 2009-2010 Markus Grueneis <gimpf@spreadspace.org> -- Christian Pointner <equinox@spreadspace.org> @@ -53,7 +53,7 @@ function tcp_listen:new(config, runtype) local lst, err = tcp.server(config.addr, config.port, config.resolv_type) if(not lst) then return nil - end + end inst.listeners = lst for _, l in ipairs(inst.listeners) do @@ -71,7 +71,7 @@ function tcp_listen:new(config, runtype) client_handle.client_instance = nil client_handle.in_buffer = "" client_handle.out_buffer = "" - function client_handle:read() + function client_handle:read() -- TODO: which size should we request?? local buffer, err = tcp.recv(self.fd, 100) if(buffer == nil) then @@ -89,7 +89,7 @@ function tcp_listen:new(config, runtype) else self.in_buffer = response_table:dispatch(self.in_buffer) end - + return defines.OK end function client_handle:write() @@ -131,7 +131,7 @@ function tcp_listen:new(config, runtype) end function l:write() return defines.OK end end - + function inst:cleanup() client_list:unregister_by_module(self) for _, l in ipairs(self.listeners) do |