IP_ADD_MEMBERSHIP2const
Join a multicast group
Usage
#include <netinet/in.h> /* Definition of IP* constants */ #include <sys/socket.h>
int setsockopt(int sockfd, IPPROTO_IP, IP_ADD_MEMBERSHIP, const struct ip_mreqn *val, sizeof(struct ip_mreqn));
Library
Standard C library (libc, -lc)
Overview
Join a multicast group.
IP_ADD_MEMBERSHIP is valid only for setsockopt(2).
Errors
See IPPROTO_IP(2const). See setsockopt(2). See ip(7).
- EINVAL
-
val->imr_multiaddr is not a valid multicast address.