clix/send.lua

changeset 36
0712fda16ab6
parent 27
5b58c002d6ad
child 164
fafdcde2e2eb
equal deleted inserted replaced
35:37540f89d4e2 36:0712fda16ab6
23 settimeout = function () end; 23 settimeout = function () end;
24 send = function (_, d) return #d, 0; end; 24 send = function (_, d) return #d, 0; end;
25 close = function () end; 25 close = function () end;
26 receive = function (_, patt) 26 receive = function (_, patt)
27 local data = io.stdin:read(patt); 27 local data = io.stdin:read(patt);
28 if data == nil then
29 conn:close();
30 end
28 if opts.echo then 31 if opts.echo then
29 io.write(data, patt == "*l" and "\n" or ""); 32 io.write(data, patt == "*l" and "\n" or "");
30 end 33 end
31 return data; 34 return data;
32 end 35 end

mercurial