socket.connect now implemented in the C core

This avoid socket.lua duplicating the iteration over the results
of getaddrinfo(). Some problems with the C implementation not
initializing sockets or the luasocket family have also been fixed,
and error reporting made more robust.
This commit is contained in:
Sam Roberts
2012-05-10 14:14:22 -07:00
parent 3d3e69c6e4
commit 156669c28b
7 changed files with 69 additions and 48 deletions

View File

@ -33,6 +33,9 @@ const char *inet_trybind(p_socket ps, const char *address, const char *serv,
int inet_meth_getpeername(lua_State *L, p_socket ps, int family);
int inet_meth_getsockname(lua_State *L, p_socket ps, int family);
int inet_optfamily(lua_State* L, int narg, const char* def);
int inet_optsocktype(lua_State* L, int narg, const char* def);
#ifdef INET_ATON
int inet_aton(const char *cp, struct in_addr *inp);
#endif