Winsock2.h and Multicast...missing definitions
Posted on 2004-10-04
I am currently trying to write some networking code in Visual C++ while trying to maintain cross platform compatibility. My current issue is that I am trying to figure out how to setup a multicast connection and join and leave groups. I already have some code which is just creating and binding a socket and then setting some options. This stuff works fine, when I try to start playing with multi cast I start running into problems, such as winsock2.h does not define many of the multicast data structures and #defines, such as ip_mreq, and IP_ADD_MEMBERSHIP. I found that these are defined in Ws2tcpip.h if I try to include this file I starti running into tons a of redfines. What is the best approach to networking in windows while still maintaining maximal cross platform compatibility. So I guess my first question is what do I need to include to get Multicast working, I would like to avoid all the WSA* calls. What then is the best way to then starting join Multicast groups.