r = new Thread (thdstHandler) ; thdHandler.Start () ; 4. The first task this thread must perform, before it can communicate with the client, is to retrieve a socket from the top of the ArrayList. Once this socket has been obtained, it can then create a stream to this client by passing the socket to the constructor of a NetworkStream. A StreamReader is used to read from the incoming NetworkStream. The incoming line is assumed to be HTTP GET in this example and the same can be extended to handle other HTTP POST. The physical path also needs to be resolved. It can be read from disk and sent out on the network stream. Then the socket is closed. The response file- Contents needs to be modified to include the HTTP headers so that the cli- ent can understand how to handle the response. public void handlerThread () Socket socketHandler = (Socket) listSockets[listSockets. Count-1] ; String streamData = " " ; String fileName = " " ; String [] input ; Fundamentals of EMS, NMS and OSS/BSS StreamReader reader; NetworkStream networkStream = new NetworkStream (socketHandler) ; reader = new StreamReader (networkStream) ; streamData = reader.ReadLine() i input = streamData.Split (" " ToCharArray ( ) ) ; // The input line is assumed to be: GET <some URL path> HTTP/1.1 // Parse the filename using input // Add the HTTP root path fileName = path + fileName FileStream fs = new FileStream fileName, FileMode. OpenOrCreate) ; fs. Seek (0, SeekOrigin.Begin) ; byte [] fileContents = new byte [fs. Length] i fs. Read (fileContents, 0, (int) fs. Length) ; fs. Close () ; // Modify fileContents to include HTTP header. socketHandler.Send (fileContents) ; socketHandler.Close( ( ) ; 5. To test the server: Create an HTML page. Save the page as index.htm at HTTP root path. Run the server. Open a browser and type in http://localhost:9080. Localhost should be replaced by the IP address of the server when server is running on a dif- ferent machine from where the browser is launched. The index.htm page is displayed. 28.5 Conclusion In a typical client-s