fixed a bug that left sockets in the CLOSE_WAIT state
[org.ibex.io.git] / src / org / ibex / io / Stream.java
index ef6c5a8..9de0322 100644 (file)
@@ -57,7 +57,7 @@ public class Stream {
     public void   println(String s)                { logWrite(s); out.write(s); out.write(newLine); flush(); }
 
     public void   flush()                          { if (out != null) try { out.w.flush(); } catch(IOException e) { ioe(e); } }
-    public void   close()                          { in.close(); out.close(); }
+    public void   close()                          { try { in.close(); } finally { out.close(); } }
     public void   setNewline(String s)             { newLine = s; }