KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tomcat > jni > Multicast


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

17
18 package org.apache.tomcat.jni;
19
20 /** Multicast
21  *
22  * @author Mladen Turk
23  * @version $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
24  */

25
26 public class Multicast {
27
28     /**
29      * Join a Multicast Group
30      * @param sock The socket to join a multicast group
31      * @param join The address of the multicast group to join
32      * @param iface Address of the interface to use. If NULL is passed, the
33      * default multicast interface will be used. (OS Dependent)
34      * @param source Source Address to accept transmissions from (non-NULL
35      * implies Source-Specific Multicast)
36      */

37     public static native int join(long sock, long join,
38                                   long iface, long source);
39
40     /**
41      * Leave a Multicast Group. All arguments must be the same as
42      * apr_mcast_join.
43      * @param sock The socket to leave a multicast group
44      * @param addr The address of the multicast group to leave
45      * @param iface Address of the interface to use. If NULL is passed, the
46      * default multicast interface will be used. (OS Dependent)
47      * @param source Source Address to accept transmissions from (non-NULL
48      * implies Source-Specific Multicast)
49      */

50     public static native int leave(long sock, long addr,
51                                    long iface, long source);
52
53     /**
54      * Set the Multicast Time to Live (ttl) for a multicast transmission.
55      * @param sock The socket to set the multicast ttl
56      * @param ttl Time to live to Assign. 0-255, default=1
57      * <br /><b>Remark :</b> If the TTL is 0, packets will only be seen
58      * by sockets on the local machine,
59      * and only when multicast loopback is enabled.
60      */

61     public static native int hops(long sock, int ttl);
62
63     /**
64      * Toggle IP Multicast Loopback
65      * @param sock The socket to set multicast loopback
66      * @param opt false=disable, true=enable
67      */

68     public static native int loopback(long sock, boolean opt);
69
70
71     /**
72      * Set the Interface to be used for outgoing Multicast Transmissions.
73      * @param sock The socket to set the multicast interface on
74      * @param iface Address of the interface to use for Multicast
75      */

76     public static native int ointerface(long sock, long iface);
77
78 }
79
Popular Tags