src/share/classes/sun/net/sdp/SdpSupport.java

Print this page




  59         return fd;
  60     }
  61 
  62     /**
  63      * Converts an existing file descriptor, that references an unbound TCP socket,
  64      * to SDP.
  65      */
  66     public static void convertSocket(FileDescriptor fd) throws IOException {
  67         if (!isSupported)
  68             throw new UnsupportedOperationException("SDP not supported on this platform");
  69         int fdVal = fdAccess.get(fd);
  70         convert0(fdVal);
  71     }
  72 
  73     private static native int create0() throws IOException;
  74 
  75     private static native void convert0(int fd) throws IOException;
  76 
  77     static {
  78         AccessController.doPrivileged(
  79             new sun.security.action.LoadLibraryAction("net"));



  80     }


  81 }


  59         return fd;
  60     }
  61 
  62     /**
  63      * Converts an existing file descriptor, that references an unbound TCP socket,
  64      * to SDP.
  65      */
  66     public static void convertSocket(FileDescriptor fd) throws IOException {
  67         if (!isSupported)
  68             throw new UnsupportedOperationException("SDP not supported on this platform");
  69         int fdVal = fdAccess.get(fd);
  70         convert0(fdVal);
  71     }
  72 
  73     private static native int create0() throws IOException;
  74 
  75     private static native void convert0(int fd) throws IOException;
  76 
  77     static {
  78         AccessController.doPrivileged(
  79             new java.security.PrivilegedAction<Void>() {
  80                 public Void run() {
  81                     System.loadLibrary("net");
  82                     return null;
  83                 }
  84             });
  85     }
  86 }