Click to See Complete Forum and Search --> : IP MULTICAST


Remek Zajac
April 21st, 1999, 07:50 PM
Hello,

I guess i don't have sufficient informations on how to use ip multicast services.
My API refuse to add me to a multicast group. It fails in the code sample provided below:


memset( &LocalAddr, 0x00, sizeof(LocalAddr));
LocalAddr.sin_family = AF_INET;
LocalAddr.sin_addr.s_addr = inet_addr("192.168.0.1"); //my local machine address
LocalAddr.sin_port = usPort;

err = bind( UDP_Soc, (struct sockaddr *)&LocalAddr, sizeof(LocalAddr));

if (err == SOCKET_ERROR)
return ER_SOCK_BIND;

mreq.imr_multiaddr.s_addr = inet_addr( "233.1.1.1" ); //arbitaral mcast addr
mreq.imr_interface.s_addr = inet_addr( "192.168.0.1" );

if (setsockopt(UDP_Soc, IPPROTO_IP, IP_ADD_MEMBERSHIP,
(char*)&mreq, sizeof(struct ip_mreq)) == SOCKET_ERROR )
return ER_SOCK_BIND; //FAILS HERE!!




This code sample is taken from the tutorials and should work.
My system:
WinNT 4.0
two network interfaces (proxy server SyGate joining LAN with Inet)
TCP/IP installed (this post is a proove)
i dont have any problems with unicast - works both outside and inside my LAN.

please help.
it sais WinNT is multicast compliant.
where do i fail?

thanks in advance
Rem

Remek Zajac
April 21st, 1999, 08:41 PM
Maybe one more thing that i've forgot:
setsockopt() returns:
/
WSAENOPROTOOPT The option is unknown or unsupported for the specified provider or socket (see SO_GROUP_PRIORITY limitations).
/

Should i ask my Inet provider on that?
Can i become a router for the IGMP msgs in my LAN?
How do i know if the setsockopt() failure is the network interface fault rather than my code's.

thanks again

HoWeR
May 22nd, 2002, 07:24 AM
Hopefully you started your socket with the Datagram option other wise the errormessage is correct. For there is no multicasting under tcp.
Not under NT at least as far as I know.

Lee Peart
May 22nd, 2002, 07:51 AM
Hi,

I'm not sure what is causing your error, but I have a couple of projects which illustrate the required steps for creating a multicast server and the client. I can't remember where I got them and there's no details of the author on the files so use them however you see fit ;)


Lee.