73 |
* Create a MulticastSocket that this not bound to any address |
* Create a MulticastSocket that this not bound to any address |
74 |
* |
* |
75 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
76 |
|
* @exception SecurityException If a security manager exists and its |
77 |
|
* checkListen method doesn't allow the operation |
78 |
*/ |
*/ |
79 |
public MulticastSocket() throws IOException |
public MulticastSocket() throws IOException |
80 |
{ |
{ |
84 |
/** |
/** |
85 |
* Create a multicast socket bound to the specified port |
* Create a multicast socket bound to the specified port |
86 |
* |
* |
87 |
* @param The port to bind to |
* @param port The port to bind to |
88 |
* |
* |
89 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
90 |
|
* @exception SecurityException If a security manager exists and its |
91 |
|
* checkListen method doesn't allow the operation |
92 |
*/ |
*/ |
93 |
public MulticastSocket(int port) throws IOException |
public MulticastSocket(int port) throws IOException |
94 |
{ |
{ |
104 |
*/ |
*/ |
105 |
public InetAddress getInterface() throws SocketException |
public InetAddress getInterface() throws SocketException |
106 |
{ |
{ |
|
// FIXME: Is it possible that an InetAddress wasn't returned from getOption? |
|
107 |
return (InetAddress) impl.getOption(SocketOptions.IP_MULTICAST_IF); |
return (InetAddress) impl.getOption(SocketOptions.IP_MULTICAST_IF); |
108 |
} |
} |
109 |
|
|
116 |
* |
* |
117 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
118 |
* |
* |
119 |
* @deprecated Replaced by getTimeToLive() in Java 1.2 |
* @deprecated 1.2 Replaced by getTimeToLive() |
120 |
|
* |
121 |
|
* @see Multicastsocket:getTimeToLive |
122 |
*/ |
*/ |
123 |
public byte getTTL() throws IOException |
public byte getTTL() throws IOException |
124 |
{ |
{ |
136 |
* |
* |
137 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
138 |
* |
* |
139 |
* @since Java 1.2 |
* @since 1.2 |
140 |
*/ |
*/ |
141 |
public int getTimeToLive() throws IOException |
public int getTimeToLive() throws IOException |
142 |
{ |
{ |
143 |
return impl.getTimeToLive(); |
return impl.getTimeToLive(); |
144 |
} |
} |
145 |
|
|
146 |
/** |
/** |
147 |
* Sets the interface to use for multicast packets. |
* Sets the interface to use for multicast packets. |
148 |
* |
* |
149 |
* @param addr The new interface to use |
* @param addr The new interface to use |
150 |
* |
* |
151 |
* @exception SocketException If an error occurs |
* @exception SocketException If an error occurs |
152 |
|
* |
153 |
|
* @since 1.4 |
154 |
*/ |
*/ |
155 |
public void setInterface(InetAddress inf) throws SocketException |
public void setInterface(InetAddress inf) throws SocketException |
156 |
{ |
{ |
165 |
* |
* |
166 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
167 |
* |
* |
168 |
* @deprecated Replaced by <code>setTimeToLive</code> in Java 1.2 |
* @deprecated 1.2 Replaced by <code>setTimeToLive</code> |
169 |
|
* |
170 |
|
* @see MulticastSocket:setTimeToLive |
171 |
*/ |
*/ |
172 |
public void setTTL(byte ttl) throws IOException |
public void setTTL(byte ttl) throws IOException |
173 |
{ |
{ |
185 |
* |
* |
186 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
187 |
* |
* |
188 |
* @since Java 1.2 |
* @since 1.2 |
189 |
*/ |
*/ |
190 |
public void setTimeToLive(int ttl) throws IOException |
public void setTimeToLive(int ttl) throws IOException |
191 |
{ |
{ |
201 |
* @param addr The address of the group to join |
* @param addr The address of the group to join |
202 |
* |
* |
203 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
204 |
|
* @exception SecurityException If a security manager exists and its |
205 |
|
* checkMulticast method doesn't allow the operation |
206 |
*/ |
*/ |
207 |
public void joinGroup(InetAddress mcastaddr) throws IOException |
public void joinGroup(InetAddress mcastaddr) throws IOException |
208 |
{ |
{ |
222 |
* @param addr The address of the group to leave |
* @param addr The address of the group to leave |
223 |
* |
* |
224 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
225 |
|
* @exception SecurityException If a security manager exists and its |
226 |
|
* checkMulticast method doesn't allow the operation |
227 |
*/ |
*/ |
228 |
public void leaveGroup(InetAddress mcastaddr) throws IOException |
public void leaveGroup(InetAddress mcastaddr) throws IOException |
229 |
{ |
{ |
246 |
* @param ttl The TTL for this packet |
* @param ttl The TTL for this packet |
247 |
* |
* |
248 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
249 |
|
* @exception SecurityException If a security manager exists and its |
250 |
|
* checkConnect or checkMulticast method doesn't allow the operation |
251 |
*/ |
*/ |
252 |
public synchronized void send(DatagramPacket p, byte ttl) throws IOException |
public synchronized void send(DatagramPacket p, byte ttl) throws IOException |
253 |
{ |
{ |