static int luv_udp_set_multicast_interface(lua_State* L) { uv_udp_t* handle = luv_check_udp(L, 1); const char* interface_addr = luaL_checkstring(L, 2); int ret = uv_udp_set_multicast_interface(handle, interface_addr); if (ret < 0) return luv_error(L, ret); lua_pushinteger(L, ret); return 1; }
static int lluv_udp_set_multicast_interface(lua_State *L){ lluv_handle_t *handle = lluv_check_udp(L, 1, LLUV_FLAG_OPEN); const char *interface_addr = luaL_checkstring(L, 2); int err = uv_udp_set_multicast_interface(LLUV_H(handle, uv_udp_t), interface_addr); if(err < 0){ return lluv_fail(L, handle->flags, LLUV_ERR_UV, err, NULL); } lua_settop(L, 1); return 1; }
CAMLprim value uwt_udp_set_multicast_interface_na(value o_udp, value o_inter) { HANDLE_INIT_NOUNINIT_NA(u, o_udp); char * iface = NULL; if ( o_inter != Val_unit ){ value s = Field(o_inter,0); if ( !uwt_is_safe_string(s) ){ return VAL_UWT_INT_RESULT_ECHARSET; } iface = String_val(s); } int ret = uv_udp_set_multicast_interface((uv_udp_t*)u->handle,iface); return (VAL_UWT_UNIT_RESULT(ret)); }
int UvUdpSocket::setMuticastInterface(string interfaceAddr) { return uv_udp_set_multicast_interface(m_uv_udp,interfaceAddr.c_str()); }