MCPcopy Create free account
hub / github.com/Tencent/UnLua / opt_get

Function opt_get

Plugins/UnLuaExtensions/LuaSocket/Source/src/options.cpp:398–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396}
397
398static
399int opt_get(lua_State *L, p_socket ps, int level, int name, void *val, int* len)
400{
401 socklen_t socklen = *len;
402 if (getsockopt(*ps, level, name, (char *) val, &socklen) < 0) {
403 lua_pushnil(L);
404 lua_pushstring(L, "getsockopt failed");
405 return 2;
406 }
407 *len = socklen;
408 return 0;
409}
410
411static
412int opt_set(lua_State *L, p_socket ps, int level, int name, void *val, int len)

Callers 3

opt_get_lingerFunction · 0.85
opt_getbooleanFunction · 0.85
opt_getintFunction · 0.85

Calls 2

lua_pushnilFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected