www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/02/20/07:05:54

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=2.6 required=5.0 tests=BAYES_50,DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG
X-Spam-Check-By: sourceware.org
Message-ID: <22119431.post@talk.nabble.com>
Date: Fri, 20 Feb 2009 04:05:36 -0800 (PST)
From: victhor_1983 <victhor_1983 AT yahoo DOT es>
To: cygwin AT cygwin DOT com
Subject: Problem Adding Membership Multicast Errno 22
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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=3Dsocket(AF_INET,SOCK_DGRAM,0);
	Puerto=3D12100;
	Direccion.sin_family=3DAF_INET;
	Direccion.sin_port=3Dhtons(Puerto);
	Direccion.sin_addr.s_addr=3Dinet_addr("224.0.22.1");
	memset(&(Direccion.sin_zero),'\0',8);=20=20=20

       	Multic.imr_multiaddr.s_addr=3Dinet_addr("224.0.22.1");
	Multic.imr_interface.s_addr=3Dinet_addr("138.4.32.34");
	status=3D setsockopt(Descriptor, IPPROTO_IP, IP_ADD_MEMBERSHIP, &Multic,
sizeof(Multic));
        if (status<0){
           printf("Fallo al a=C3=B1adir el grupo de Multicast, codigo %i\n",
errno);
	}

I would really appreciate your help with this. Thanks in advance.
Victor


--=20
View this message in context: http://www.nabble.com/Problem-Adding-Membersh=
ip-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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019