home *** CD-ROM | disk | FTP | other *** search
- package java.net;
-
- import java.io.IOException;
-
- public class MulticastSocket extends DatagramSocket {
- public MulticastSocket() throws IOException {
- }
-
- public MulticastSocket(int var1) throws IOException {
- super(var1);
- }
-
- void create(int var1, InetAddress var2) throws SocketException {
- SecurityManager var3 = System.getSecurityManager();
- if (var3 != null) {
- var3.checkListen(var1);
- }
-
- try {
- super.impl = (DatagramSocketImpl)DatagramSocket.implClass.newInstance();
- } catch (Exception var5) {
- throw new SocketException("can't instantiate DatagramSocketImpl" + ((Throwable)var5).toString());
- }
-
- super.impl.create();
- super.impl.setOption(4, new Integer(-1));
- super.impl.bind(var1, InetAddress.anyLocalAddress);
- }
-
- public void setTTL(byte var1) throws IOException {
- super.impl.setTTL(var1);
- }
-
- public byte getTTL() throws IOException {
- return super.impl.getTTL();
- }
-
- public void joinGroup(InetAddress var1) throws IOException {
- SecurityManager var2 = System.getSecurityManager();
- if (var2 != null) {
- var2.checkMulticast(var1);
- }
-
- super.impl.join(var1);
- }
-
- public void leaveGroup(InetAddress var1) throws IOException {
- SecurityManager var2 = System.getSecurityManager();
- if (var2 != null) {
- var2.checkMulticast(var1);
- }
-
- super.impl.leave(var1);
- }
-
- public void setInterface(InetAddress var1) throws SocketException {
- super.impl.setOption(16, var1);
- }
-
- public InetAddress getInterface() throws SocketException {
- return (InetAddress)super.impl.getOption(16);
- }
-
- public synchronized void send(DatagramPacket var1, byte var2) throws IOException {
- SecurityManager var3 = System.getSecurityManager();
- if (var3 != null) {
- if (var1.getAddress().isMulticastAddress()) {
- var3.checkMulticast(var1.getAddress(), var2);
- } else {
- var3.checkConnect(var1.getAddress().getHostAddress(), var1.getPort());
- }
- }
-
- byte var4 = this.getTTL();
- if (var2 != var4) {
- super.impl.setTTL(var2);
- }
-
- super.impl.send(var1);
- if (var2 != var4) {
- super.impl.setTTL(var4);
- }
-
- }
- }
-