X-Spam-Check-By: sourceware.org Message-ID: <44E41DD8.6070205@sh.cvut.cz> Date: Thu, 17 Aug 2006 09:42:16 +0200 From: =?ISO-8859-1?Q?V=E1clav_Haisman?= User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Cygwin 1.5.18: Problem using setsockopt() for multicast References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5519F22C9E9E873C4177F451" X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------enig5519F22C9E9E873C4177F451 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Alessandro Saffiotti wrote: > Hi there, > > I ran into the following problem when using setsockopt to create a > multicast receiver in my own application. Here is the relevant part > of the code: > > ---------------------------------------------------------------------- > . > . > . > tcp_broadcast_receiver =3D socket(PF_INET,SOCK_DGRAM,IPPROTO_IP); > > memset(&imreq, 0, sizeof(struct ip_mreq)); > imreq.imr_multiaddr.s_addr =3D inet_addr("227.1.3.5"); > imreq.imr_interface.s_addr =3D INADDR_ANY; > > if(setsockopt(tcp_broadcast_receiver, IPPROTO_IP, IP_ADD_MEMBERSHIP,=20 > (const void *)&imreq, sizeof(struct ip_mreq)) !=3D 0) > perror("Error joining multicast group"); > . > . > . > ---------------------------------------------------------------------- > > It compiles ok, but when I run it setsockopt fails producing the > following report: > > Error joining multicast group: Invalid argument > > I have noted that a similar problem was reported long time ago, when > support for multicast was not implemented, but I understand that this > support is not available. > > I have also read the discussion about the conflicting values for > constants between winsock1 and winsock2. I have tried to replace > IP_ADD_MEMBERSHIP by hardcoding either 5 (winsock1) or 12 (winsok2), > but I get the same behavior. > > I run Cygwin 1.5.18 on Windows XP pro SP2. > > Any hints? > Thanks! > > Alessandro Saffiotti >=20=20=20 I do not know whether it works with 1.5.21 but you should always test with the latest version before you create a problem report. -- Vaclav Haisman --------------enig5519F22C9E9E873C4177F451 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEVAwUBROQd5UNOZDESBK8FAQJerQgAlNvx1qF2naSGz3ZnS+N24RYFtX9NTTBp HcdQch4LRlX9aZ97oZ0Fn5Cv3VhisnVTNyahN+NjnBNkY82mO1nh5LTN6tuk6GO4 2XRMtk/wa9PDoFn8tT8/M1q6/ETsn/sNx1h2gNxFnu71Fd5LwXJLdaXBOM1FME7N 61GzSEVEiOmym6gNJOHiom/l6B4Tkg1r6zM71jRDc32V4tVGhJynj2jXEMdFDJ0Y /s6aaWuE0YR6NIGQN/F89F5uTnUeKAXMIeDLhhEDC4/k8VzD+AB+jtyQzGETsnF5 uhNFbZPBW7SHDbR5tAC+yblSzVQt5WnANvpIN2D5GvtcSfSAImwZiQ== =WlAp -----END PGP SIGNATURE----- --------------enig5519F22C9E9E873C4177F451--