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
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