--Prepends "Received: " to each received message and "Sending: " to each --sent one. Also, prints "appender.lua greets you!" at startup. io.stdout:write "appender.lua greets you!\n" io.stdout:flush() return { recv = function (self) local line, err = self.super:recv() if line == nil then return line, err end return "Received: " .. line end, send = function (self, buf) self.super:send("Sending: " .. buf) end, }