src/java.base/share/classes/sun/nio/ch/UnixDomainServerSocketChannelImpl.java
branchunixdomainchannels
changeset 59076 998df1368cca
parent 59052 15e9a570c6e6
equal deleted inserted replaced
59074:7917f95f74c4 59076:998df1368cca
    25 
    25 
    26 package sun.nio.ch;
    26 package sun.nio.ch;
    27 
    27 
    28 import java.io.FileDescriptor;
    28 import java.io.FileDescriptor;
    29 import java.io.IOException;
    29 import java.io.IOException;
       
    30 import java.net.BindException;
    30 import java.net.ServerSocket;
    31 import java.net.ServerSocket;
    31 import java.net.SocketAddress;
    32 import java.net.SocketAddress;
    32 import java.net.SocketOption;
    33 import java.net.SocketOption;
    33 import java.net.SocketTimeoutException;
    34 import java.net.SocketTimeoutException;
    34 import java.net.StandardProtocolFamily;
    35 import java.net.StandardProtocolFamily;
   133         return DefaultOptionsHolder.defaultOptions;
   134         return DefaultOptionsHolder.defaultOptions;
   134     }
   135     }
   135 
   136 
   136     @Override
   137     @Override
   137     public ServerSocketChannel bind(SocketAddress local, int backlog) throws IOException {
   138     public ServerSocketChannel bind(SocketAddress local, int backlog) throws IOException {
       
   139 	if (local == null)
       
   140 	    throw new BindException("automatic bind not possible for Unix domain servers");
       
   141 
   138         synchronized (stateLock) {
   142         synchronized (stateLock) {
   139             ensureOpen();
   143             ensureOpen();
   140             if (localAddress != null)
   144             if (localAddress != null)
   141                 throw new AlreadyBoundException();
   145                 throw new AlreadyBoundException();
   142             UnixDomainSocketAddress usa = Net.checkUnixAddress(local);
   146             UnixDomainSocketAddress usa = Net.checkUnixAddress(local);