|
|
@@ -93,14 +93,15 @@ func (c *dgramOpt) SetMulticastLoopback(on bool) error {
|
|
|
return setInt(fd, &sockOpts[ssoMulticastLoopback], boolint(on))
|
|
|
}
|
|
|
|
|
|
-// JoinGroup joins the group address group on the interface ifi. By
|
|
|
-// default all sources that can cast data to group are accepted. It's
|
|
|
-// possible to mute and unmute data transmission from a specific
|
|
|
+// JoinGroup joins the group address group on the interface ifi.
|
|
|
+// By default all sources that can cast data to group are accepted.
|
|
|
+// It's possible to mute and unmute data transmission from a specific
|
|
|
// source by using ExcludeSourceSpecificGroup and
|
|
|
// IncludeSourceSpecificGroup.
|
|
|
-// It uses the system assigned multicast interface when ifi is nil,
|
|
|
-// although this is not recommended because the assignment depends on
|
|
|
-// platforms and sometimes it might require routing configuration.
|
|
|
+// JoinGroup uses the system assigned multicast interface when ifi is
|
|
|
+// nil, although this is not recommended because the assignment
|
|
|
+// depends on platforms and sometimes it might require routing
|
|
|
+// configuration.
|
|
|
func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {
|
|
|
if !c.ok() {
|
|
|
return syscall.EINVAL
|
|
|
@@ -116,9 +117,9 @@ func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {
|
|
|
return setGroup(fd, &sockOpts[ssoJoinGroup], ifi, grp)
|
|
|
}
|
|
|
|
|
|
-// LeaveGroup leaves the group address group on the interface ifi.
|
|
|
-// It's allowed to leave the group which is formed by
|
|
|
-// JoinSourceSpecificGroup for convenience.
|
|
|
+// LeaveGroup leaves the group address group on the interface ifi
|
|
|
+// regardless of whether the group is any-source group or
|
|
|
+// source-specific group.
|
|
|
func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {
|
|
|
if !c.ok() {
|
|
|
return syscall.EINVAL
|
|
|
@@ -134,11 +135,12 @@ func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {
|
|
|
return setGroup(fd, &sockOpts[ssoLeaveGroup], ifi, grp)
|
|
|
}
|
|
|
|
|
|
-// JoinSourceSpecificGroup joins the source-specific group consisting
|
|
|
-// group and source on the interface ifi. It uses the system assigned
|
|
|
-// multicast interface when ifi is nil, although this is not
|
|
|
-// recommended because the assignment depends on platforms and
|
|
|
-// sometimes it might require routing configuration.
|
|
|
+// JoinSourceSpecificGroup joins the source-specific group comprising
|
|
|
+// group and source on the interface ifi.
|
|
|
+// JoinSourceSpecificGroup uses the system assigned multicast
|
|
|
+// interface when ifi is nil, although this is not recommended because
|
|
|
+// the assignment depends on platforms and sometimes it might require
|
|
|
+// routing configuration.
|
|
|
func (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
|
|
|
if !c.ok() {
|
|
|
return syscall.EINVAL
|
|
|
@@ -180,8 +182,8 @@ func (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source ne
|
|
|
}
|
|
|
|
|
|
// ExcludeSourceSpecificGroup excludes the source-specific group from
|
|
|
-// the already joined groups by either JoinGroup or
|
|
|
-// JoinSourceSpecificGroup on the interface ifi.
|
|
|
+// the already joined any-source groups by JoinGroup on the interface
|
|
|
+// ifi.
|
|
|
func (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
|
|
|
if !c.ok() {
|
|
|
return syscall.EINVAL
|