Package org.apache.tomcat.jni
Class Multicast
- java.lang.Object
-
- org.apache.tomcat.jni.Multicast
-
public class Multicast extends Object
Multicast- Author:
- Mladen Turk
-
-
Constructor Summary
Constructors Constructor Description Multicast()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static inthops(long sock, int ttl)Set the Multicast Time to Live (ttl) for a multicast transmission.static intjoin(long sock, long join, long iface, long source)Join a Multicast Groupstatic intleave(long sock, long addr, long iface, long source)Leave a Multicast Group.static intloopback(long sock, boolean opt)Toggle IP Multicast Loopbackstatic intointerface(long sock, long iface)Set the Interface to be used for outgoing Multicast Transmissions.
-
-
-
Method Detail
-
join
public static int join(long sock, long join, long iface, long source)Join a Multicast Group- Parameters:
sock- The socket to join a multicast groupjoin- The address of the multicast group to joiniface- Address of the interface to use. If NULL is passed, the default multicast interface will be used. (OS Dependent)source- Source Address to accept transmissions from (non-NULL implies Source-Specific Multicast)- Returns:
- the operation status
-
leave
public static int leave(long sock, long addr, long iface, long source)Leave a Multicast Group. All arguments must be the same as apr_mcast_join.- Parameters:
sock- The socket to leave a multicast groupaddr- The address of the multicast group to leaveiface- Address of the interface to use. If NULL is passed, the default multicast interface will be used. (OS Dependent)source- Source Address to accept transmissions from (non-NULL implies Source-Specific Multicast)- Returns:
- the operation status
-
hops
public static int hops(long sock, int ttl)Set the Multicast Time to Live (ttl) for a multicast transmission.- Parameters:
sock- The socket to set the multicast ttlttl- Time to live to Assign. 0-255, default=1
Remark : If the TTL is 0, packets will only be seen by sockets on the local machine, and only when multicast loopback is enabled.- Returns:
- the operation status
-
loopback
public static int loopback(long sock, boolean opt)Toggle IP Multicast Loopback- Parameters:
sock- The socket to set multicast loopbackopt- false=disable, true=enable- Returns:
- the operation status
-
ointerface
public static int ointerface(long sock, long iface)Set the Interface to be used for outgoing Multicast Transmissions.- Parameters:
sock- The socket to set the multicast interface oniface- Address of the interface to use for Multicast- Returns:
- the operation status
-
-