lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

I'm trying to use luasockets + msgpack together,
as it looks like msgpack supports ltn12, but I just can't
seem to get it to work:

    sock = socket.tcp(cv)
    src = "">
    for _, v in mp.unpacker(src) do
        print(v)
    end


Results in:
 bad argument #1 to unpacker (string or function expected, got table)

Whereas the following works:

local ltn12 = require 'ltn12'
src = "" 'r'))
for _, v in mp.unpacker(src) do
    print(v)
end

Is there something wrong with the source that the socket is producing, as it seems to
be a table?

cheers

Chris