Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one or more
  *  contributor license agreements.  See the NOTICE file distributed with
  *  this work for additional information regarding copyright ownership.
  *  The ASF licenses this file to You under the Apache License, Version 2.0
  *  (the "License"); you may not use this file except in compliance with
  *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.apache.tomcat.jni;

Multicast

Author(s):
Mladen Turk
Version:
$Revision: 515 $, $Date: 2008-03-17 22:02:23 +0100 (Mon, 17 Mar 2008) $
public class Multicast {

    
Join a Multicast Group

Parameters:
sock The socket to join a multicast group
join The address of the multicast group to join
iface 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)
    public static native int join(long socklong join,
                                  long ifacelong source);

    
Leave a Multicast Group. All arguments must be the same as apr_mcast_join.

Parameters:
sock The socket to leave a multicast group
addr The address of the multicast group to leave
iface 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)
    public static native int leave(long socklong addr,
                                   long ifacelong source);

    
Set the Multicast Time to Live (ttl) for a multicast transmission.

Parameters:
sock The socket to set the multicast ttl
ttl 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.
    public static native int hops(long sockint ttl);

    
Toggle IP Multicast Loopback

Parameters:
sock The socket to set multicast loopback
opt false=disable, true=enable
    public static native int loopback(long sockboolean opt);


    
Set the Interface to be used for outgoing Multicast Transmissions.

Parameters:
sock The socket to set the multicast interface on
iface Address of the interface to use for Multicast
    public static native int ointerface(long socklong iface);
New to GrepCode? Check out our FAQ X