< prev index next >

src/java.base/windows/classes/sun/nio/ch/SocketDispatcher.java

Print this page




  42 
  43     SocketDispatcher() { }
  44 
  45     int read(FileDescriptor fd, long address, int len) throws IOException {
  46         return read0(fd, address, len);
  47     }
  48 
  49     long readv(FileDescriptor fd, long address, int len) throws IOException {
  50         return readv0(fd, address, len);
  51     }
  52 
  53     int write(FileDescriptor fd, long address, int len) throws IOException {
  54         return write0(fd, address, len);
  55     }
  56 
  57     long writev(FileDescriptor fd, long address, int len) throws IOException {
  58         return writev0(fd, address, len);
  59     }
  60 
  61     void preClose(FileDescriptor fd) throws IOException {
  62         throw new UnsupportedOperationException();
  63     }
  64 
  65     void close(FileDescriptor fd) throws IOException {
  66         invalidateAndClose(fd);
  67     }
  68 
  69     static void invalidateAndClose(FileDescriptor fd) throws IOException {
  70         assert fd.valid();
  71         int fdVal = fdAccess.get(fd);
  72         fdAccess.set(fd, -1);
  73         close0(fdVal);
  74     }
  75 
  76     // -- Native methods --
  77 
  78     private static native int read0(FileDescriptor fd, long address, int len)
  79         throws IOException;
  80 
  81     private static native long readv0(FileDescriptor fd, long address, int len)
  82         throws IOException;


  42 
  43     SocketDispatcher() { }
  44 
  45     int read(FileDescriptor fd, long address, int len) throws IOException {
  46         return read0(fd, address, len);
  47     }
  48 
  49     long readv(FileDescriptor fd, long address, int len) throws IOException {
  50         return readv0(fd, address, len);
  51     }
  52 
  53     int write(FileDescriptor fd, long address, int len) throws IOException {
  54         return write0(fd, address, len);
  55     }
  56 
  57     long writev(FileDescriptor fd, long address, int len) throws IOException {
  58         return writev0(fd, address, len);
  59     }
  60 
  61     void preClose(FileDescriptor fd) throws IOException {
  62         // do nothing
  63     }
  64 
  65     void close(FileDescriptor fd) throws IOException {
  66         invalidateAndClose(fd);
  67     }
  68 
  69     static void invalidateAndClose(FileDescriptor fd) throws IOException {
  70         assert fd.valid();
  71         int fdVal = fdAccess.get(fd);
  72         fdAccess.set(fd, -1);
  73         close0(fdVal);
  74     }
  75 
  76     // -- Native methods --
  77 
  78     private static native int read0(FileDescriptor fd, long address, int len)
  79         throws IOException;
  80 
  81     private static native long readv0(FileDescriptor fd, long address, int len)
  82         throws IOException;
< prev index next >