publicstaticvoid main(String[] args) throws IOException {
InetAddress loopbackAddress = InetAddress.getLoopbackAddress(); try (ServerSocket ss = new ServerSocket(0, 0, loopbackAddress)) { try (Socket s = new Socket(loopbackAddress, ss.getLocalPort());
Socket peer = ss.accept()) { for (int i=0; i<1000000; i++) { // buggy JDK will run out of memory in this loop
s.getOutputStream(); // test InputStream also while we're here
s.getInputStream(); if (i % 100000 == 0) System.out.println(i);
}
}
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.