Revert "Update the return values of socket.listen, also return the real port bind to zero (#1638)"

This reverts commit c1eeba215d.
This commit is contained in:
Cloud Wu
2022-09-03 22:03:11 +08:00
parent 6dda5f7f98
commit 800a3376d6
10 changed files with 18 additions and 30 deletions

View File

@@ -488,14 +488,13 @@ llisten(lua_State *L) {
int port = luaL_checkinteger(L,2);
int backlog = luaL_optinteger(L,3,BACKLOG);
struct skynet_context * ctx = lua_touserdata(L, lua_upvalueindex(1));
int id = skynet_socket_listen(ctx, host, &port, backlog);
int id = skynet_socket_listen(ctx, host,port,backlog);
if (id < 0) {
return luaL_error(L, "Listen error");
}
lua_pushinteger(L,id);
lua_pushinteger(L,port);
return 2;
return 1;
}
static size_t