5 * $Id: MyWebServer.java,v 1.1 2008/05/15 22:21:43 rmh3093 Exp rmh3093 $
8 * $Log: MyWebServer.java,v $
9 * Revision 1.1 2008/05/15 22:21:43 rmh3093
14 import java
.io
.IOException
;
15 import java
.net
.ServerSocket
;
16 import java
.util
.LinkedList
;
22 public class MyWebServer
{
24 LinkedList
<Servant
> activeServants
= new LinkedList
<Servant
>();
27 * Create a new web server
29 public MyWebServer() {
32 ServerSocket socket
= new ServerSocket(0);
33 int port
= socket
.getLocalPort();
34 System
.out
.println("Listening for connection on port: " + port
);
35 activeServants
.add(new Servant(socket
.accept()));
36 System
.out
.println("Serving connection on port: " + port
);
37 new Thread(activeServants
.getLast()).start();
38 } catch (IOException e
) {
44 * @param args [ignored]
46 public static void main(String
[] args
) {