mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
remove close in lua-socket, because socket will be closed in connection service
This commit is contained in:
@@ -40,13 +40,6 @@ _open(lua_State *L) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
_close(lua_State *L) {
|
|
||||||
int fd = luaL_checkinteger(L,1);
|
|
||||||
close(fd);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_blockwrite(int fd, const char * buffer, size_t sz) {
|
_blockwrite(int fd, const char * buffer, size_t sz) {
|
||||||
while (sz > 0) {
|
while (sz > 0) {
|
||||||
@@ -313,7 +306,6 @@ int
|
|||||||
luaopen_socket_c(lua_State *L) {
|
luaopen_socket_c(lua_State *L) {
|
||||||
luaL_Reg l[] = {
|
luaL_Reg l[] = {
|
||||||
{ "open", _open },
|
{ "open", _open },
|
||||||
{ "close", _close },
|
|
||||||
{ "write", _write },
|
{ "write", _write },
|
||||||
{ "new", _new },
|
{ "new", _new },
|
||||||
{ "push", _push },
|
{ "push", _push },
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ end
|
|||||||
|
|
||||||
function socket.close()
|
function socket.close()
|
||||||
if fd then
|
if fd then
|
||||||
c.close(fd)
|
|
||||||
skynet.send(".connection","text", "DEL", fd)
|
skynet.send(".connection","text", "DEL", fd)
|
||||||
fd = nil
|
fd = nil
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user