MCPcopy Create free account
hub / github.com/apache/thrift / l_socket_connect

Function l_socket_connect

lib/lua/src/luasocket.c:370–380  ·  view source on GitHub ↗

connect(host, port)

Source from the content-addressed store, hash-verified

368
369// connect(host, port)
370static 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}

Callers

nothing calls this directly

Calls 3

checktypeFunction · 0.85
tcp_connectFunction · 0.85
settypeFunction · 0.85

Tested by

no test coverage detected