Skip to Main Content
Java™ Performance and Scalability, Volume 1: Server-Side Programming Techniques
book

Java™ Performance and Scalability, Volume 1: Server-Side Programming Techniques

by Dov Bulka
June 2000
Intermediate to advanced content levelIntermediate to advanced
320 pages
5h 54m
English
Addison-Wesley Professional
Content preview from Java™ Performance and Scalability, Volume 1: Server-Side Programming Techniques

Appendix B. Simple Java Web Server

Server.java

 import java.io.*; import java.net.*; import java.util.*; import UrlCache; import MyGetBytes; import LazyDate; import FileInfo; class Server implements HttpConstants { // Print to stdout protected static void p(String s) { System.out.println(s); } // Print to the log file protected static void log(byte[] b) throws IOException { synchronized (log) { log.write(b, 0, b.length); } } static OutputStream log = null; /* our server's configuration information is stored * in these properties */ protected static Properties props = new Properties(); // Where worker threads stand idle static Vector threads = new Vector(); // The web server's virtual root static File root; // Timeout on client connections static ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology

Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology

Greg Barish

Publisher Resources

ISBN: 0201704293Purchase book