socket.shutdown abandon unsend buffer now, see issue #371

This commit is contained in:
Cloud Wu
2015-11-11 10:44:50 +08:00
parent c28ae25c70
commit 7521fe0530
6 changed files with 39 additions and 6 deletions

View File

@@ -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 },