Unable to receive multicast traffick when specifying ANY
I have a unmanaged c++ application that also runs on Mac/Linux/Soalris. Since I moved to Windows7 x64 RC (I was on Vista x64 before) my program stopped working. After some debugging it looks like I have to explicitly specify which interface I need to bind with. If I specify INADDR_ANY it does not work. Would this be a network driver issue (Intel (R) WiFi Link 5100AGN version 12.4.1.4 date 3/26/2009) or is this a Windoes issue?Here are general steps that I am takingm_socket = socket( AF_INET, SOCK_DGRAM, 0);//IPPROTO_UDP); unsigned int on(1); int ret = setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, (SETOPTCAST)(&on), sizeof(on) ); memset( (void*)&m_servaddr, 0, sizeof(m_servaddr) ); m_servaddr.sin_family= AF_INET;m_servaddr.sin_port= htons( m_port ); m_servaddr.sin_addr.s_addr= htonl( INADDR_ANY );// Does not work//m_servaddr.sin_addr.s_addr= inet_addr( "192.168.0.99") ); // Works int ret = bind(m_socket, (SOCKADDR*)&m_servaddr, sizeof(m_servaddr)); // No Error here on both cases mreq.imr_multiaddr.s_addr = inet_addr( mcgroup.c_str() ); mreq.imr_interface.s_addr = htonl(INADDR_ANY );// Does not workmreq.imr_interface.s_addr = inet_addr( "192.168.0.99") ); // Works setsockopt(m_socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (SETOPTCAST)(&mreq), sizeof(mreq)); when I try to read I block for ever (INADDR_ANY) or works when local IF specifiedCheersRobert
June 24th, 2009 11:16pm

Hi Robert: You'd find more help for this question at the MSDN Developer forums. This forum isn't meant for discussion of development issues. Best of luck, Nick
Free Windows Admin Tool Kit Click here and download it now
June 26th, 2009 1:12am

I understand. But it sure looks like this is a problem with Windows 7. Since the same code with out any changes does work on Vista x32. x64 as well XP. (including linux mac and solaris)
June 30th, 2009 5:28am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics