diff options
author | Christian Pointner <equinox@spreadspace.org> | 2010-12-26 19:54:40 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2010-12-26 19:54:40 +0000 |
commit | 00e8809aed2a25ca495887b1fad239a90ffd2431 (patch) | |
tree | a337d974a69c9bbc929f142d872dbaafb26eee0d | |
parent | updated TODO (diff) |
cleanup
git-svn-id: https://svn.spreadspace.org/gcsd/trunk@79 ac14a137-c7f1-4531-abe0-07747231d213
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | examples/dynamic_dispatch_table.lua | 24 |
2 files changed, 12 insertions, 14 deletions
@@ -1,5 +1,3 @@ - * ignore response table when output is write only - * no expected response at basic mode when output is write only * send response to requestor * out-of-order responses * add listener tables (for requests, responses and other messages) diff --git a/examples/dynamic_dispatch_table.lua b/examples/dynamic_dispatch_table.lua index 4d94fa2..38b8bae 100644 --- a/examples/dynamic_dispatch_table.lua +++ b/examples/dynamic_dispatch_table.lua @@ -1,16 +1,16 @@ local get_length_table = { - [".."] = function(match) - local bytes = string.byte(match, 1, 2) - local length = bytes[1] * 256^2 + bytes[2] -- TODO byte order? - local get_binary_data_table = { - [string.rep(".", length)] = function(match) - command_queue:enqueue(match) - dispatch_table:register_handler_table(get_length_table) - end - } - - dispatch_table:register_handler_table(get_binary_data_table) - end + [".."] = function(match) + local bytes = string.byte(match, 1, 2) + local length = bytes[1] * 256^2 + bytes[2] -- TODO byte order? + local get_binary_data_table = { + [string.rep(".", length)] = function(match) + command_queue:enqueue(match) + dispatch_table:register_handler_table(get_length_table) + end + } + + dispatch_table:register_handler_table(get_binary_data_table) + end } local responses = { |