-------------------------------------------------------------------------*\ * Shuts the connection down partially \*-------------------------------------------------------------------------*/
| 307 | * Shuts the connection down partially |
| 308 | \*-------------------------------------------------------------------------*/ |
| 309 | static int meth_shutdown(lua_State *L) |
| 310 | { |
| 311 | /* SHUT_RD, SHUT_WR, SHUT_RDWR have the value 0, 1, 2, so we can use method index directly */ |
| 312 | static const char* methods[] = { "receive", "send", "both", NULL }; |
| 313 | p_unix stream = (p_unix) auxiliar_checkclass(L, "unixstream{client}", 1); |
| 314 | int how = luaL_checkoption(L, 2, "both", methods); |
| 315 | socket_shutdown(&stream->sock, how); |
| 316 | lua_pushnumber(L, 1); |
| 317 | return 1; |
| 318 | } |
| 319 | |
| 320 | /*-------------------------------------------------------------------------*\ |
| 321 | * Just call tm methods |
nothing calls this directly
no test coverage detected