diff options
author | chai <chaifix@163.com> | 2018-11-22 12:23:12 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-22 12:23:12 +0800 |
commit | 7a20483f06624e82feb129c9e4c8fa13881a6a9f (patch) | |
tree | 82707e7546fe14d1b781a2e15f65f6ef976ac322 /src/lua/modules/net/je_lua_net.cpp | |
parent | 7256d216ecf154d6418c1f3b36dd58a2b69b7827 (diff) |
*修改lua bind
Diffstat (limited to 'src/lua/modules/net/je_lua_net.cpp')
-rw-r--r-- | src/lua/modules/net/je_lua_net.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lua/modules/net/je_lua_net.cpp b/src/lua/modules/net/je_lua_net.cpp index 178a93e..456bcf8 100644 --- a/src/lua/modules/net/je_lua_net.cpp +++ b/src/lua/modules/net/je_lua_net.cpp @@ -50,17 +50,15 @@ namespace Lua } } Socket* socket = new Socket(info); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Socket); - proxy->bind(new Shared<Socket>(socket, Jin_Lua_Socket)); + Proxy* proxy = luax_newinstance(L, Jin_Lua_Socket, new Shared<Socket>(socket, Jin_Lua_Socket)); return 1; } LUA_IMPLEMENT int l_Buffer(lua_State* L) { int size = luax_checkinteger(L, 1); - Proxy* proxy = luax_newinstance(L, Jin_Lua_Buffer); Net::Buffer* buffer = new Net::Buffer(size); - proxy->bind(new Shared<Buffer>(buffer, Jin_Lua_Buffer)); + Proxy* proxy = luax_newinstance(L, Jin_Lua_Buffer, new Shared<Buffer>(buffer, Jin_Lua_Buffer)); return 1; } @@ -69,13 +67,13 @@ namespace Lua luaopen_Socket(L); luaopen_Buffer(L); - luaL_Reg f[] = { + luaL_Reg methods[] = { { "init", l_initNetwork }, { "newSocket", l_Socket }, { "newBuffer", l_Buffer }, { 0, 0 } }; - luax_newlib(L, f); + luax_newlib(L, methods); return 1; } |