X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TD2%2Fclient%2FClientSimplifie.java;h=b676c6591c1647a8c736444e0783b12fdfff05a1;hb=6b300998692af2dca53cf1fe97305d27b56430b0;hp=84fecb56e6b974b6385e1baacd12fd4417954341;hpb=e018d1ec033513412d9b3628a7d6701a48725382;p=TD_SR.git diff --git a/TD2/client/ClientSimplifie.java b/TD2/client/ClientSimplifie.java index 84fecb5..b676c65 100644 --- a/TD2/client/ClientSimplifie.java +++ b/TD2/client/ClientSimplifie.java @@ -38,20 +38,19 @@ public class ClientSimplifie { // puis établie les chaînages de flot nécessaires // pour l'envoi et la reception de messages sock = new Socket(adresseIPServeur, portServeur); - InputStream IStream = null; - IStream = sock.getInputStream(); - InputStreamReader IMesg = new InputStreamReader(IStream); - lecture = new BufferedReader(IMesg); - OutputStream OStream = null; - OStream = sock.getOutputStream(); + OutputStream OStream = sock.getOutputStream(); ecriture = new PrintWriter(OStream); + + InputStream IStream = sock.getInputStream(); + InputStreamReader IMesg = new InputStreamReader(IStream); + lecture = new BufferedReader(IMesg); } private void attributesInit() { + sock = null; lecture = null; ecriture = null; - sock = null; } /** @@ -69,7 +68,7 @@ public class ClientSimplifie { */ public String receiveMsg() throws IOException { String line = new String(); - //FIXME: read only the line before the ending newline + //FIXME?: read only the line before the ending newline line = lecture.readLine(); return line; }