connect(host, port)
| 368 | |
| 369 | // connect(host, port) |
| 370 | static int l_socket_connect(lua_State *L) { |
| 371 | const char *err; |
| 372 | p_tcp tcp = (p_tcp) checktype(L, 1, SOCKET_GENERIC); |
| 373 | const char *host = luaL_checkstring(L, 2); |
| 374 | unsigned short port = luaL_checknumber(L, 3); |
| 375 | err = tcp_connect(&tcp->sock, host, port, tcp->timeout); |
| 376 | if (!err) { |
| 377 | settype(L, 1, SOCKET_CLIENT); // Now a client |
| 378 | } |
| 379 | LUA_CHECK_RETURN(L, err); |
| 380 | } |
nothing calls this directly
no test coverage detected