This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Problem Adding Membership Multicast Errno 22
- From: victhor_1983 <victhor_1983 at yahoo dot es>
- To: cygwin at cygwin dot com
- Date: Fri, 20 Feb 2009 04:05:36 -0800 (PST)
- Subject: Problem Adding Membership Multicast Errno 22
Hi,
I have written a C++ program for a Multicast Client that compiles and runs
on Ubuntu. I tried to compile and run it on Cygwin version 1.5.25 (June
2008). However, when I run the code, the Multicast receiving socket doesn't
seem to work. The problem comes when I use setsockopt() to add Multicast
membership. The errno() declaration returns 22 (EINVAL), but I cannot find a
solution. My code is:
int Descriptor, Descriptor2, payloadoffset,sqnum, T_ns, status;
long nsegundos,Dnsegundos, segundos, Dsegundos;
struct sockaddr_in Direccion, Direccion2;
unsigned short Puerto;
struct timespec valorcontador,valorcontador2,Next;
struct ip_mreq Multic;
Descriptor=socket(AF_INET,SOCK_DGRAM,0);
Puerto=12100;
Direccion.sin_family=AF_INET;
Direccion.sin_port=htons(Puerto);
Direccion.sin_addr.s_addr=inet_addr("224.0.22.1");
memset(&(Direccion.sin_zero),'\0',8);
Multic.imr_multiaddr.s_addr=inet_addr("224.0.22.1");
Multic.imr_interface.s_addr=inet_addr("138.4.32.34");
status= setsockopt(Descriptor, IPPROTO_IP, IP_ADD_MEMBERSHIP, &Multic,
sizeof(Multic));
if (status<0){
printf("Fallo al aÃadir el grupo de Multicast, codigo %i\n",
errno);
}
I would really appreciate your help with this. Thanks in advance.
Victor
--
View this message in context: http://www.nabble.com/Problem-Adding-Membership-Multicast-Errno-22-tp22119431p22119431.html
Sent from the Cygwin list mailing list archive at Nabble.com.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/