jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java
changeset 24623 c094ffea7aee
parent 23010 6dadb192ad81
equal deleted inserted replaced
24622:0b2ad6558dc6 24623:c094ffea7aee
    91     }
    91     }
    92 
    92 
    93 
    93 
    94     public Socket accept() throws IOException {
    94     public Socket accept() throws IOException {
    95         synchronized (ssc.blockingLock()) {
    95         synchronized (ssc.blockingLock()) {
    96             if (!ssc.isBound())
       
    97                 throw new IllegalBlockingModeException();
       
    98             try {
    96             try {
       
    97                 if (!ssc.isBound())
       
    98                     throw new NotYetBoundException();
    99                 if (timeout == 0) {
    99                 if (timeout == 0) {
   100                     SocketChannel sc = ssc.accept();
   100                     SocketChannel sc = ssc.accept();
   101                     if (sc == null && !ssc.isBlocking())
   101                     if (sc == null && !ssc.isBlocking())
   102                         throw new IllegalBlockingModeException();
   102                         throw new IllegalBlockingModeException();
   103                     return sc.socket();
   103                     return sc.socket();