X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Fri, 20 Feb 2009 13:55:34 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Problem Adding Membership Multicast Errno 22 Message-ID: <20090220125534.GD24834@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <22119431 DOT post AT talk DOT nabble DOT com> <20090220124814 DOT GC24834 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20090220124814.GC24834@calimero.vinschen.de> User-Agent: Mutt/1.5.17 (2007-11-01) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Feb 20 13:48, Corinna Vinschen wrote: > On Feb 20 04:05, victhor_1983 wrote: > > 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'm sorry, I can't tell you why this doesn't work. Cygwin's setsockopt > function is basically just a shim between application and Winsock's > setsockopt call. It only performs special actions on a very limited > set of options, only two actually: (SOL_SOCKET, SO_REUSEADDR) and > (IPPROTO_IP, IP_TOS). I'm also quite multicast illiterate. Is it > possible that you have to use the IP_MULTICAST_IF option on Windows > before you can use IP_ADD_MEMBERSHIP?!? Here's one idea: Is it possible that your application includes winsock.h? If so, don't do that, use the POSIX headers for socket and ip stuff. Winsock.h is the WInsock specific header file for applications using the old Winsock 1.x API. In that API, IP_ADD_MEMBERSHIP is defined as the value 5. However, the newer Winsock 2.x API, which is used by Cygwin under the hood as well, defines IP_ADD_MEMBERSHIP as the value 12. So, if there's any chance that you're including the winsock.h header, remove it and only use Cygwin's header files, not the Winsock specifc header files. Hope that helps, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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/