mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
socket.shutdown abandon unsend buffer now, see issue #371
This commit is contained in:
@@ -461,6 +461,14 @@ lclose(lua_State *L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
lshutdown(lua_State *L) {
|
||||
int id = luaL_checkinteger(L,1);
|
||||
struct skynet_context * ctx = lua_touserdata(L, lua_upvalueindex(1));
|
||||
skynet_socket_shutdown(ctx, id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
llisten(lua_State *L) {
|
||||
const char * host = luaL_checkstring(L,1);
|
||||
@@ -639,6 +647,7 @@ luaopen_socketdriver(lua_State *L) {
|
||||
luaL_Reg l2[] = {
|
||||
{ "connect", lconnect },
|
||||
{ "close", lclose },
|
||||
{ "shutdown", lshutdown },
|
||||
{ "listen", llisten },
|
||||
{ "send", lsend },
|
||||
{ "lsend", lsendlow },
|
||||
|
||||
Reference in New Issue
Block a user