Subject: server side programming?

From: "Tapan Divekar" <[email-masked]>
Date: Sun, 29 Jul 2001 07:35:14 +0000

Hi ,
I ve been trying to write  a small HTTP Server app. which shall take in 
requests from browser and send some results back (in Java).
serverSocket is created on port 4444.
Following is a snippet from the code --

Socket clientSocket = null;

        try {
            clientSocket = serverSocket.accept();
        } catch (IOException e) {
            System.err.println("Accept failed.");
            System.exit(1);
        }

			PrintWriter os = new PrintWriter(clientSocket.getOutputStream(),true);
//DataInputStream is = new DataInputStream(clientSocket.getInputStream());
			BufferedReader is =new BufferedReader(new 
InputStreamReader(clientSocket.getInputStream()));
String fromServer=new String();
while ((fromServer = is.readLine()) != null) {

    System.out.println("Server: " + fromServer);

	os.println("<html>hello lhlg  </html>");
	System.out.println("Server:  before flush");

	 os.flush();
		System.out.println("Server: after flush");
}
}

Even though server receives some data it is unable to post data back.
Any ideas where I might be going wrong?
Thanks
Tapan

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp