+ " is waiting, size: " + nbObj);
wait();
}
- catch (InterruptedException e) {}
+ catch (InterruptedException e) {
+ System.out.println("InterruptedException: " + e);
+ }
}
nbObj++;
tampon[prem] = obj;
+ " is waiting, size: " + nbObj);
wait();
}
- catch (InterruptedException e) {}
+ catch (InterruptedException e) {
+ System.out.println("InterruptedException: " + e);
+ }
}
Object outObj = null;
nbObj--;
try {
sock = new Socket(adresseIPServeur, portServeur);
}
- catch (IOException e) {}
+ catch (IOException e) {
+ System.out.println("IOException: " + e);
+ }
InputStream IStream = null;
try {
IStream = sock.getInputStream();
}
- catch (IOException e) {}
+ catch (IOException e) {
+ System.out.println("IOException: " + e);
+ }
InputStreamReader IMesg = new InputStreamReader(IStream);
lecture = new BufferedReader(IMesg);
try {
OStream = sock.getOutputStream();
}
- catch (IOException e) {}
+ catch (IOException e) {
+ System.out.println("IOException: " + e);
+ }
ecriture = new PrintWriter(OStream);
}
+ /**
+ * Send a message on the opened client socket
+ * @param msg a string containing the message to send
+ */
public void sendMsg(String msg) {
ecriture.println(msg);
ecriture.flush();
}
+ /**
+ * Receive a message sent on the opened client socket
+ * @return a string containing the received message
+ */
public String receiveMsg() {
String line = new String();
try {
//FIXME: read only the line before the ending newline
line = lecture.readLine();
}
- catch (IOException e) {}
+ catch (IOException e) {
+ System.out.println("IOException: " + e);
+ }
return line;
}
+ /**
+ * Close all opened I/O streams attached to this object instance
+ */
public void closeRWIO() {
ecriture.close();
try {
lecture.close();
}
- catch (IOException e) {}
+ catch (IOException e) {
+ System.out.println("IOException: " + e);
+ }
}
} // fin classe ClientSimplifie