[Live-devel] IP_ADD_MEMBERSHIP error in test programs

Victor Kozhuhov vkozhuhov at gmx.net
Tue Nov 21 09:59:33 PST 2006


ManualIt does not affect multicast feature. 
There is no limitation for Winsock regarding multicast interface, and in general case it can be INADDR_ANY.
(Consider, that MS sample works fine, however it uses INADDR_ANY as a multicast interface).

The proper answer is a bit more sophisticated, but very short:
All you have to do is to specify _WINNT compiler directive (or other suitable).

The following code is in the NetCommon.h

#if defined(WINNT) || defined(_WINNT) || defined(__BORLANDC__) || defined(__MINGW32__) || defined(_WIN32_WCE)
#define _MSWSOCK_
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#include <windows.h>
#include <string.h>
....
#endif

So by default live library includes winsock.h through windows.h instead of winsock2.h, but requires Winsock 2 in  initializeWinsockIfNecessary(...) function.
IP_ADD_MEMBERSHIP value for Winsock1 is 5, and for Winsock 2 is 12.
Therefore socketJoinGroup(...) function is trying to call setsockopt(IP_ADD_MEMBERSHIP) from Winsock 2 with optname from Winsock 1. 
There is the confusion between Winsock versions.

Had no time to find out why it happens - actually windows makefile includes NTWIN32.MAK / WIN32.MAK (from VC and/or SDK) that adds WINNT directive to $(cflags), but not in my case.

Regards, 
Victor.
  ----- Original Message ----- 
  From: Stas Desyatnlkov 
  To: LIVE555 Streaming Media - development & use 
  Sent: Tuesday, November 21, 2006 10:52 AM
  Subject: Re: [Live-devel] IP_ADD_MEMBERSHIP error in test programs


  Change ReceivingInterfaceAddr variable to point to the Ethernet adapter you trying to use for multicast.

   

   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20061121/e737f93c/attachment-0001.html 


More information about the live-devel mailing list