-------------------------------------------------------------------------*\ * Shuts the connection down partially \*-------------------------------------------------------------------------*/
| 338 | * Shuts the connection down partially |
| 339 | \*-------------------------------------------------------------------------*/ |
| 340 | static int meth_shutdown(lua_State *L) |
| 341 | { |
| 342 | /* SHUT_RD, SHUT_WR, SHUT_RDWR have the value 0, 1, 2, so we can use method index directly */ |
| 343 | static const char* methods[] = { "receive", "send", "both", NULL }; |
| 344 | p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); |
| 345 | int how = luaL_checkoption(L, 2, "both", methods); |
| 346 | socket_shutdown(&tcp->sock, how); |
| 347 | lua_pushnumber(L, 1); |
| 348 | return 1; |
| 349 | } |
| 350 | |
| 351 | /*-------------------------------------------------------------------------*\ |
| 352 | * Just call inet methods |
nothing calls this directly
no test coverage detected