Code cleanups.
[TD_SR.git] / TD2 / client / ClientSimplifie.java
index 84fecb56e6b974b6385e1baacd12fd4417954341..b676c6591c1647a8c736444e0783b12fdfff05a1 100644 (file)
@@ -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;
     }