Close the stream after writing to stream in client program
br.close();
After Writing to stream it is compulsory to close the stream or flush the stream(br.flush()
) because when stream is closed then only that stream can be read.
I/O operations can not be performed on same stream simultaneously.
Two sockets are connected by same stream so I/O operations can not be performed simultaneously on that stream.