Skip to content
Snippets Groups Projects
Commit 48622ed2 authored by dg's avatar dg
Browse files

less crude luasocket itegration

git-svn-id: http://svn.net-core.org/repos/t-engine4@524 51575b47-30f0-44d4-a5cc-537603b46e54
parent d98806f3
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,6 @@ function _M:loadRemoteList(src)
local l = lanes.linda()
function list_handler(src)
require "socketed"
local http = require "socket.http"
local ltn12 = require "ltn12"
......
......@@ -64,7 +64,6 @@ function _M:startDownload()
local l = lanes.linda()
function list_handler(src)
require "socketed"
local http = require "socket.http"
local ltn12 = require "ltn12"
......
......@@ -26,7 +26,3 @@ if jit then
else
print("LuaVM:", _VERSION)
end
-- Requiring "socketed" instead of "socket" makes sockets work
-- Thsi is due to the way luasocket is embeded statically in TE4
require "socketed"
......@@ -10,7 +10,7 @@
local base = _G
local string = require("string")
local math = require("math")
local socket = require("socket")
local socket = require("socketcore")
module("socket")
-----------------------------------------------------------------------------
......
local print = print
local dofile = dofile
local socket = require("socket")
module("socketed")
if not socket.connect then
dofile("/socket.lua")
end
return socket
......@@ -89,7 +89,10 @@ static int global_unload(lua_State *L) {
static int base_open(lua_State *L) {
if (socket_open()) {
/* export functions (and leave namespace table on top of stack) */
luaL_openlib(L, "socket", func, 0);
lua_newtable(L);
luaL_register(L, "socketcore", func);
lua_setglobal(L, "socket");
lua_getglobal(L, "socket");
#ifdef LUASOCKET_DEBUG
lua_pushstring(L, "_DEBUG");
lua_pushboolean(L, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment