Well, the client is probably executing the readLine(), which means it will keep waiting until it sees something that signals the end of the line.
Incidentally it's a very bad idea to have those empty catch blocks. If something goes wrong and you do get an exception, the empty catch block will silently catch the exception, without giving you any useful information about what happened. Which makes it very difficult to detect the problem, much less fix it. I suggest replacing the catch blocks with something like:
but why is it so that if i write bufferedwriter.close() instead of bufferedwriter.newline() and bufferedwriter.flush() , then the client successfully prints even though the line is not ending?
thank you very much........
readline() behaves like Mike have specified. It blocks until it runs into "\n", "\r", "\r\n", or EOF.
However it still keeps data already read in. It just won't be returned until function comes across one of previously specified delimiters.
Maybe because your computer is behind a firewall or a router which does NAT (network address translation), which causes your computer to have a different IP address in the local network than on the outside Internet.