| www.delorie.com/archives/browse.cgi | search |
| X-Spam-Check-By: | sourceware.org |
| From: | "Dave Korn" <dave DOT korn AT artimi DOT com> |
| To: | <cygwin AT cygwin DOT com> |
| Subject: | RE: Cygwin 1.5.18: Problem using setsockopt() for multicast |
| Date: | Thu, 17 Aug 2006 14:48:42 +0100 |
| Message-ID: | <00cf01c6c203$da04b5b0$a501a8c0@CAM.ARTIMI.COM> |
| MIME-Version: | 1.0 |
| X-Mailer: | Microsoft Office Outlook 11 |
| In-Reply-To: | <Pine.CYG.4.58.0608170836160.2408@PC1163-8460-XP.flightsafety.com> |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 |
On 17 August 2006 14:45, Brian Ford wrote:
> On Thu, 17 Aug 2006, Alessandro Saffiotti wrote:
>
>> 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 = socket(PF_INET,SOCK_DGRAM,IPPROTO_IP);
>>
>> memset(&imreq, 0, sizeof(struct ip_mreq));
>> imreq.imr_multiaddr.s_addr = inet_addr("227.1.3.5");
>> imreq.imr_interface.s_addr = INADDR_ANY;
>
> INADDR_ANY is in host byte order, but you need network order for this
> call.
Yeh, that's it! And don't forget to use left-handed bits - the ordinary
right-handed ones are no good for INADDR_ANY. :)
cheers,
DaveK
--
Can't think of a witty .sigline today....
--
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |