lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


This is primarily to Diego, but may be of interest to others.

Using luasocket to prototype some socket coding (which it is wonderful for), I found one possible bug, and one feature I would like for completeness.

The code for setting multicast ttl (LuaSocket 2.02 and earlier) is :

int opt_ip_multicast_ttl(lua_State *L, p_socket ps)
{
    int val = (int) luaL_checknumber(L, 3);    /* obj, name, int */
    return opt_set(L, ps, SOL_SOCKET, SO_LINGER, (char *) &val, sizeof(val));
}

where I expected something like :

int opt_ip_multicast_ttl(lua_State *L, p_socket ps)
{
    int val = (int) luaL_checknumber(L, 3);    /* obj, name, int */
return opt_set(L, ps, IPPROTO_IP, IP_MULTICAST_TTL, (char *) &val, sizeof(val));
}


Also, can we have the option to set the outbound multicast interface ? The call to be implemented is a wrapper for :

setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &addr, sizeof(addr));


Adrian