whats wrong with this code.message is send to server and reaches there but it's not send back to the client.server hangs if the clietn doesn't read the stream it works else it doesn't.tell the error in the code .try it out please. I added the UBB tag CODE to allow easier reading [This message has been edited by Carl Trusiak (edited January 27, 2001).] [This message has been edited by Carl Trusiak (edited January 27, 2001).]
Carl Trusiak
Sheriff
Joined: Jun 13, 2000
Posts: 3340
posted
0
Two things jump out. strt=is.readLine(); System.out.println(strt); os.writeChars(str); You are trying to read the response from the Server Before you send the message! Change this to os.writeChars(str); strt=is.readLine(); System.out.println(strt); And the message will be sent to the server. This is the first thing. The second os.writeChars(str); Doesn't send an end of line character. Using the streams you are using, you need to specifically send an end of line os.writeChars(str); os.write(10); This will complete the communications. Once you see this, you may want to rethink the streams you are using to allow cleaner communications.