es that can be used for creating active documents, though Applet is used in the Java context. The client applications will execute within a container application such as the browser. 28.4 Implementing Web Server The server implementation is similar to the socket server program discussed in the Chapter 26 on socket programming. C# is used in this example, SO that the reader can identify how different the implementation is when different programming lan- guages are used. The example program is given sufficient comments and description to help the reader develop a program in the language of their choice. 1. At the base of a HTTP server is a TCP server. The server has to be multithre- aded, SO an array list of sockets is declared to handle multiple connections. private ArrayList listSockets; 2. Every HTTP server has an HTTP root, which is a path to a folder on the hard disk from which the server will retrieve Web pages. This path needs to be set. Then initialize the array list of sockets and start the main server thread. // Set the path; String path = " < path > " i listSockets = new ArrayList ( ) ; Thread threadListener = new Thread (new ThreadStart (newConnection). ) ; threadListener.Start ( ) ; 3. The newConnection function manages new incoming connections, allocating each new connection to a new thread for handling client requests. HTTP operates over port 80. In this program we have set the port as 9080 and this can be customized. Start the TcpListener on the port specified. This thread runs in an infinite loop and waits for a socket connection for invoking AcceptSocket method. Once the socket is connected a new thread called the socketHandler function. Web Communication public void newConnection () // Specify port to use int port = 9080; TcpListener tcpListener = new TcpListener (port) tcpListener.Start () ; while (true) Socket socketHandler = tcpListener. AcceptSocket () ; if (handlerSocket.Connected) listSockets.Add (socketHandler) ; ThreadStart thdstHandler = new ThreadStart (handlerThread) ; Thread thdHandle