src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java
branchunixdomainchannels
changeset 58847 692de65ab293
parent 58801 119ac9128c1b
child 58911 2c777f25cfff
equal deleted inserted replaced
58832:203fceb089fc 58847:692de65ab293
    62 
    62 
    63 /**
    63 /**
    64  * An implementation of SocketChannels
    64  * An implementation of SocketChannels
    65  */
    65  */
    66 
    66 
    67 public abstract class SocketChannelImpl
    67 abstract class SocketChannelImpl
    68     extends SocketChannel
    68     extends SocketChannel
    69     implements SelChImpl
    69     implements SelChImpl
    70 {
    70 {
    71     // Used to make native read and write calls
    71     // Used to make native read and write calls
    72     private static final NativeDispatcher nd = new SocketDispatcher();
    72     private static final NativeDispatcher nd = new SocketDispatcher();
   116     // -- End of fields protected by stateLock
   116     // -- End of fields protected by stateLock
   117 
   117 
   118 
   118 
   119     // Constructor for normal connecting sockets
   119     // Constructor for normal connecting sockets
   120     //
   120     //
   121     public SocketChannelImpl(SelectorProvider sp) throws IOException {
   121     SocketChannelImpl(SelectorProvider sp) throws IOException {
   122         super(sp);
   122         super(sp);
   123         this.fd = Net.socket(true);
   123         this.fd = Net.socket(true);
   124         this.fdVal = IOUtil.fdVal(fd);
   124         this.fdVal = IOUtil.fdVal(fd);
   125     }
   125     }
   126 
   126 
   127     public SocketChannelImpl(SelectorProvider sp, FileDescriptor fd)
   127     SocketChannelImpl(SelectorProvider sp, FileDescriptor fd)
   128         throws IOException
   128         throws IOException
   129     {
   129     {
   130         super(sp);
   130         super(sp);
   131         this.fd = fd;
   131         this.fd = fd;
   132         this.fdVal = IOUtil.fdVal(fd);
   132         this.fdVal = IOUtil.fdVal(fd);
   763                 tryFinishClose();
   763                 tryFinishClose();
   764             }
   764             }
   765         }
   765         }
   766     }
   766     }
   767 
   767 
   768     /**
       
   769      * Package private version called from InheritedChannel
       
   770      */
       
   771     void localImplCloseSelectableChannel() throws IOException {
       
   772         implCloseSelectableChannel();
       
   773     }
       
   774 
       
   775     @Override
   768     @Override
   776     public SocketChannel shutdownInput() throws IOException {
   769     public SocketChannel shutdownInput() throws IOException {
   777         synchronized (stateLock) {
   770         synchronized (stateLock) {
   778             ensureOpen();
   771             ensureOpen();
   779             if (!isConnected())
   772             if (!isConnected())