Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Sep 1997 21:27:57 -0700
From:      Dave Hayes <dave@jetcafe.org>
To:        freebsd-multimedia@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Multicast socket programming question
Message-ID:  <199709090427.VAA06437@hokkshideh.jetcafe.org>

next in thread | raw e-mail | index | archive | help
I really don't know where else to turn to, so I'll see who can
answer this one. 

Consider:

fd = socket(AF_INET, SOCK_DGRAM, 0);
...
sin.sin_addr.s_addr = <some class D address>;
connect(fd, (struct sockaddr *)&sin, sizeof(sin));
...
c = 0;
setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &c, 1);
c = 3;
setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &c, 1);
addr = INADDR_ANY;
setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, &addr, sizeof(addr));
...
send(fd, (char*)buf, len, 0)

The send() call above returns EHOSTUNREACH. UDP multicast datagrams don't
connect to a host. Why is this error returned?
------
Dave Hayes - Altadena CA, USA - dave@jetcafe.org 
  >>> The opinions expressed above are entirely my own <<<
Freedom Knight of Usenet - http://www.jetcafe.org/~dave/usenet

People who dream impossible dreams and strive to achieve them raise man's
stature a fraction of an inch in the process, whether they win or lose.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709090427.VAA06437>