public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Chin Chee-Kai <cheekai@gen.co.jp>
To: "Bruce D. McLeod" <b.mcleod@opengroup.org>
Cc: gnu-win32@cygnus.com
Subject: Re: multicast
Date: Wed, 19 Mar 1997 23:02:00 -0000	[thread overview]
Message-ID: <Pine.3.07.9703201550.B18043-b100000@sumimasen.gen.co.jp> (raw)
In-Reply-To: <2.2.32.19970319161614.0092ac74@postman.osf.org>

Interesting trial you have there.  I ran your code as-is on
an SGI (which supports multicast send/receive) and didn't
manage to get multicasting.  Finally, I got a line fixed and
got it running on SGI doing multicast sending/receiving.
Later, I got it compiled on Win95 and tried on the
combination SGI-receiving/Win95-sending and got the right result.
Unfortunately, Win95 doesn't allow me to emulate being on
a multicast network (using Control-Panel to set another 
IP Adapter to 224.x.x.x address), so I can't try the reverse
combination  (Win95-receiving/SGI-sending).


Basically, the change is:

  localAddr.sin_addr.s_addr = *((long *) myHostent->h_addr_list[0]);

to

  localAddr.sin_addr.s_addr = inet_addr(gMyMultiIp);


The idea is that you need to bind to the multicasting
network address, logically as if this host also has a
local address at this multicasting address.  The idea
is much like "localhost" (127.0.0.1) being the address
of the local machine.  So if your machine+OS+network card
supports multicasting, then the Class D networks starting
from "224.0.0.0" are also logically the address of the
local machine.

The operation is not so clear if you first bind a socket
to a unicast IP address (the one returned by gethostbyname())
and subsequently add multicast membership to a unicast-recipient
socket using setsockopt(... IP_ADD_MEMBERSHIP...)
(by which time bind() would have  already named a socket with
a unicast address.  On the other hand, setsockopt() could
undo the semantics of bind() on seeing IP_ADD_MEMBERSHIP
so that the socket can be a recipient of a multicast network.
This is implementation dependent [It's not that clean IMHO].)



Chin Chee-Kai (Last, First)
Internet Email-ID:	cheekai@gen.co.jp



-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

  reply	other threads:[~1997-03-19 23:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-19 10:28 multicast Bruce D. McLeod
1997-03-19 23:02 ` Chin Chee-Kai [this message]
1997-03-19 18:13 multicast Bruce D. McLeod
1999-10-08  7:08 multicast Laszlo Vecsey
1999-10-31 19:54 ` multicast Laszlo Vecsey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.3.07.9703201550.B18043-b100000@sumimasen.gen.co.jp \
    --to=cheekai@gen.co.jp \
    --cc=b.mcleod@opengroup.org \
    --cc=gnu-win32@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).