< prev index next >

test/jdk/java/nio/channels/TestUtil.java

Print this page
rev 59105 : imported patch corelibs


  60                 ssc.socket().bind(isa);
  61             } catch (IOException x) {
  62                 continue;
  63             }
  64             return p;
  65         }
  66     }
  67 
  68     // A more convenient form of bind(ServerSocketChannel) that returns a full
  69     // socket address.
  70     //
  71     static InetSocketAddress bindToRandomPort(ServerSocketChannel ssc)
  72         throws IOException
  73     {
  74         int p = bind(ssc);
  75         return new InetSocketAddress(InetAddress.getLocalHost(), p);
  76     }
  77 
  78     private static String osName = System.getProperty("os.name");
  79 
  80     static boolean onSolaris() {
  81         return osName.startsWith("SunOS");
  82     }
  83 
  84     static boolean onWindows() {
  85         return osName.startsWith("Windows");
  86     }
  87 }


  60                 ssc.socket().bind(isa);
  61             } catch (IOException x) {
  62                 continue;
  63             }
  64             return p;
  65         }
  66     }
  67 
  68     // A more convenient form of bind(ServerSocketChannel) that returns a full
  69     // socket address.
  70     //
  71     static InetSocketAddress bindToRandomPort(ServerSocketChannel ssc)
  72         throws IOException
  73     {
  74         int p = bind(ssc);
  75         return new InetSocketAddress(InetAddress.getLocalHost(), p);
  76     }
  77 
  78     private static String osName = System.getProperty("os.name");
  79 




  80     static boolean onWindows() {
  81         return osName.startsWith("Windows");
  82     }
  83 }
< prev index next >