static int lbind(lua_State *L) { struct skynet_context * ctx = lua_touserdata(L, lua_upvalueindex(1)); int fd = luaL_checkinteger(L, 1); int id = skynet_socket_bind(ctx,fd); lua_pushinteger(L,id); return 1; }
// driver.bind // socket.bind socket.lua static int lbind(lua_State *L) { struct skynet_context * ctx = lua_touserdata(L, lua_upvalueindex(1)); int fd = luaL_checkinteger(L, 1); // skynet_socket_bind skynet_socket // socket_server_bind socket_server // send_request 'B' // bind_socket int id = skynet_socket_bind(ctx,fd); lua_pushinteger(L,id); return 1; }