From 00e8809aed2a25ca495887b1fad239a90ffd2431 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 26 Dec 2010 19:54:40 +0000 Subject: cleanup git-svn-id: https://svn.spreadspace.org/gcsd/trunk@79 ac14a137-c7f1-4531-abe0-07747231d213 --- TODO | 2 -- examples/dynamic_dispatch_table.lua | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/TODO b/TODO index 2dfd0bc..82501a9 100644 --- a/TODO +++ b/TODO @@ -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 = { -- cgit v1.2.3