lua-users home
lua-l archive

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


Hello,

I am trying to port LuaSockets to use LWIP(http://www.lwip.org) socket
implementation on the ARM7 processor with FreeRTOS.
Unfortunately the LuaSockets is built as a shared library and I need
to put it into lua core(I cannot use dynamic linking facility).
My only success was adding line {"socket.core", luaopen_socket_core}
to the static const luaL_Reg lualibs[] variable with
> socket = require("socket")
> print(socket._VERSION) --> LuaSocket 2.0.2.

>From this point everything fails, e.g.
> http = require("socket.http")
> print(http.request("http://www.cs.princeton.edu/~diego/professional/luasocket";))
stdin:1: attempt to call field 'request' (a nil value)
stack traceback:
	stdin:1: in main chunk
	[C]: ?

Paths are correct. The problem seems to be in modules because I cannot
se the "socket.core" in
> for i,v in pairs(package.loaded) do  print(i)  print(v) end
string
table: 0x9b2e588
debug
table: 0x9b317a8
package
table: 0x9b2ea50
_G
table: 0x9b2d450
io
table: 0x9b2f9c0
os
table: 0x9b301c8
table
table: 0x9b2e828
math
table: 0x9b30da8
mime
table: 0x9b33de8
coroutine
table: 0x9b2e718
socket
table: 0x9b31d50

The LuaSocket is only for demonstrating purposes, I think that these
issues will with most modules. I have tried to find some howto but
failed.
Thank you very much for your help.

Regards,
Martin Velek