lua-users home
lua-l archive

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


On 6 February 2013 21:27, Сергей Расюкевич <rasukevich@ok.by> wrote:
Hello,

I have problem with lua shared library ( liblua.so)
I need to use memcached server at my logic. But problem is that I can't use socket shared library.

local socket = require('socket.core');

Problem is that socket.tcp is always nil . But library loaded.
All works fine form console, but not via liblua shared library and httpd.

Did anyone encounter the same issue?

Lua 5.1
Apache/2.2.23
centos 64 -  2.6.18-348.1.1.el5


Output from  printing table.show(package.loaded['socket.core']
tcp is absent :(

__unnamed__ = {\n
    ["protect"] = "function: 0x1ad83750, C function";\n
    ["dns"] = {\n
            ["gethostname"] = "function: 0x1ad83ac0, C function";\n
            ["tohostname"] = "function: 0x1ad83af0, C function";\n
            ["toip"] = "function: 0x1ad83a60, C function";\n
    };\n

    ["gettime"] = "function: 0x1ad837b0, C function";\n
    ["udp"] = "function: 0x1b0c2750, C function";\n
    ["newtry"] = "function: 0x1ad83600, C function";\n
    ["_VERSION"] = "LuaSocket 2.0.2";\n
    ["__unload"] = "function: 0x1ad836c0, C function";\n
    ["select"] = "function: 0x1b0c2540, C function";\n
    ["skip"] = "function: 0x1ad83660, C function";\n
    ["_DEBUG"] = true;\n
    ["sleep"] = "function: 0x1ad83980, C function";\n};

Console execution:

hello , tcp :)

__unnamed__ = {
   ["protect"] = "function: 0x79996a0, C function";
   ["dns"] = {
      ["gethostname"] = "function: 0x799ae50, C function";
      ["tohostname"] = "function: 0x799ae80, C function";
      ["toip"] = "function: 0x7999370, C function";
   };
   ["gettime"] = "function: 0x7999700, C function";
   ["udp"] = "function: 0x799e110, C function";
   ["newtry"] = "function: 0x7998810, C function";
   ["_VERSION"] = "LuaSocket 2.0.2";
   ["__unload"] = "function: 0x7998640, C function";
   ["select"] = "function: 0x799dd80, C function";
   ["tcp"] = "function: 0x799cc80, C function";
   ["skip"] = "function: 0x7998870, C function";
   ["_DEBUG"] = true;
   ["sleep"] = "function: 0x7999290, C function";
};




 
Why are you requiring socket.core instead of just "socket"