Re: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Václav Haisman
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: -- . . .

Re: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Corinna Vinschen
On Aug 17 01:42, 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: [...] if(setsockopt(tcp_broadcast_receiver, IPPROTO_IP, IP_ADD_MEMBERSHIP,

Re: Re: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Alessandro Saffiotti
Thanks for the prompt reaction! On Thu, 17 Aug 2006, Corinna Vinschen wrote: On Aug 17 01:42, Alessandro Saffiotti wrote: 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

Re: Re: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Corinna Vinschen
On Aug 17 12:37, Alessandro Saffiotti wrote: Thanks for the prompt reaction! On Thu, 17 Aug 2006, Corinna Vinschen wrote: On Aug 17 01:42, Alessandro Saffiotti wrote: I have also read the discussion about the conflicting values for constants between winsock1 and winsock2. I

Re: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Brian Ford
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,

RE: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Dave Korn
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 =

Re: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Václav Haisman
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);

RE: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Brian Ford
On Thu, 17 Aug 2006, Dave Korn wrote: On 17 August 2006 14:45, Brian Ford wrote: On Thu, 17 Aug 2006, Alessandro Saffiotti wrote: 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

Re: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Corinna Vinschen
On Aug 17 09:06, Brian Ford wrote: My point should have been that I use this construct every day in 1.5.18 and 1.5.21 within our application and it works fine. I saw very few differences. Here is my snippet in case I missed something else obvious: fd = socket(AF_INET, SOCK_DGRAM, 0); Oh

Re: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Brian Ford
On Thu, 17 Aug 2006, Corinna Vinschen wrote: On Aug 17 09:06, Brian Ford wrote: Oh yeah, you must call the setsockopt below after the bind on windows. Search MSDN for why. P.S.: Do you know the MSDN articel off-hand, maybe? http://support.microsoft.com/default.aspx?scid=kb;en-us;131978

RE: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Alessandro Saffiotti
On Thu, 17 Aug 2006, Brian Ford wrote: Oh yeah, you must call the setsockopt below after the bind on windows. Search MSDN for why. Thanks a lot, this actually fixed my problem. In case it may help someone else: I also need to make the socket reusable by setsockopt(tcp_broadcast_receiver,

Re: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Corinna Vinschen
On Aug 17 11:29, Brian Ford wrote: On Thu, 17 Aug 2006, Corinna Vinschen wrote: On Aug 17 09:06, Brian Ford wrote: Oh yeah, you must call the setsockopt below after the bind on windows. Search MSDN for why. P.S.: Do you know the MSDN articel off-hand, maybe?

RE: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Brian Ford
On Thu, 17 Aug 2006, Alessandro Saffiotti wrote: On Thu, 17 Aug 2006, Brian Ford wrote: Oh yeah, you must call the setsockopt below after the bind on windows. Search MSDN for why. Thanks a lot, this actually fixed my problem. You're welcome. Sorry for the initial noise. In case it may

RE: Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-17 Thread Alessandro Saffiotti
On Thu, 17 Aug 2006, Brian Ford wrote: and I have found that this, contrary to the IP_ADD_MEMBERSHIP case, must be called BEFORE I bind the socket! Um, that makes sense, doesn't it? I guess it does. I just wanted to mention it since the sentence Note that it is necessary to bind to an

Cygwin 1.5.18: Problem using setsockopt() for multicast

2006-08-16 Thread Alessandro Saffiotti
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 =