How could I embedded socket in Lua internally, just like oslib, debuglib? -
I want to implement functions such as embedded socket function in your Leah build. So I do not need to copy socket.core.dll (just for fun). Searches
I Manlist am, and some people are discussing this subject,
I
I tried these steps in Windows XP with VC 2008 I am asking for a description, which can give me a detailed step to change the Lua and Luusut code (not by the DLL method).
1) Copy the Luasocket code to the Lua project.
2) add some code
Private Const Lauel_rag Lalibiks [] = {{ "" "luaopen_base} {LUA_LOADLIBNAME, luaopen_package} {LUA_TABLIBNAME, luaopen_table} {LUA_IOLIBNAME, luaopen_io } {LUA_OSLIBNAME, luaopen_os} {LUA_STRLIBNAME, luaopen_string} {LUA_MATHLIBNAME, luaopen_math} {LUA_DBLIBNAME, luaopen_debug} {LUA_SOCKETLIBNAME, luaopen_socket_core}, // add this line {LUA_MIMELIBNAME, luaopen_socket_core}, // add this line {NULL, NULL} };
3) construction of the project, and run it.
when I print (socket._VERSION)
type, then This is Luasocket 2.0.2
, that's correct.
When I type print ( socket.dns.toip ( "localhost"))
, the 127.0 displays .0.1 table: 00480AD0
, it is true.
But when I have other characteristics the'm trying to use bind for example, it may not work.
Who can tell me why?
You need loot stuff in the package.
LuaGetfield (L., AUDA-Globassandex, "package"); Lua_getfield (L., -1, "preload"); Lua_pushcfunction (L, LuAoPen_Socket_Core); Lua_setfield (L, -2, "socket.core"); // Add mime.core to yourself ...
Comments
Post a Comment