0

In my application I have 2 programmes, called server.java and client.java, server.java acts as a server and client.java acts as a client. From server.java, I am writing some data to client.java, by using the following code:

bufferedwriter.write(data);
bufferedwriter.flush();

to read the above data in client i have written the below code:

if(bufferedreader.ready())
while((a=in.read)!= -1)

I am able to receive data from server to client,but the problem is whenever I kept a breakpoint at BufferedWriter. flush in server.java programme and if(bufferedreader.ready()) of client.java,it is not going to intented destination (i.e, in my application intended destination is if(bufferedreader.ready()) of client.java), but whenever I am closing server.java debugging, the debugging point in client programme is enabling, can you please help me to solve this.

udalmik
  • 7,838
  • 26
  • 40
Sai Sai
  • 115
  • 2
  • 4
  • 17
  • you are using mark on stream ? – Arpit Feb 23 '13 at 07:16
  • thanks for your reply Arpit,i am not using any mark,is it compulsory to use,if yes how to use and where to use in my application, can you please help me to solve this – Sai Sai Feb 23 '13 at 07:23

1 Answers1

0

I think it is possible that your IDE blocks all threads at breakpoint. Could you please check debug settings. In Intellij IDEA it would be simple Right click on breakpoint -> Suspend, Thread

udalmik
  • 7,838
  • 26
  • 40
  • thanks for your reply mudalov, i am using netbeans as IDE how can i set in this netbeans – Sai Sai Feb 23 '13 at 08:43
  • Haven't used it for a while, but take a look at [this question](http://stackoverflow.com/questions/8174408/does-a-breakpoint-halt-all-threads) for Netbeans related details. – udalmik Feb 23 '13 at 10:43