From 14d84e00550e124892b6fb7ec93a019ca9fad373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=A3=8E?= Date: Sat, 29 Dec 2012 10:32:38 +0800 Subject: [PATCH] remove close in lua-socket, because socket will be closed in connection service --- connection/lua-socket.c | 8 -------- lualib/socket.lua | 1 - 2 files changed, 9 deletions(-) diff --git a/connection/lua-socket.c b/connection/lua-socket.c index 54acd0e0..133fb500 100644 --- a/connection/lua-socket.c +++ b/connection/lua-socket.c @@ -40,13 +40,6 @@ _open(lua_State *L) { return 1; } -static int -_close(lua_State *L) { - int fd = luaL_checkinteger(L,1); - close(fd); - return 0; -} - static int _blockwrite(int fd, const char * buffer, size_t sz) { while (sz > 0) { @@ -313,7 +306,6 @@ int luaopen_socket_c(lua_State *L) { luaL_Reg l[] = { { "open", _open }, - { "close", _close }, { "write", _write }, { "new", _new }, { "push", _push }, diff --git a/lualib/socket.lua b/lualib/socket.lua index 5eb2ace5..9dda19e5 100644 --- a/lualib/socket.lua +++ b/lualib/socket.lua @@ -70,7 +70,6 @@ end function socket.close() if fd then - c.close(fd) skynet.send(".connection","text", "DEL", fd) fd = nil end