explicitly close sockets
[org.ibex.io.git] / src / org / ibex / io / Connection.java
index bb7907b..4233315 100644 (file)
@@ -10,6 +10,7 @@ public class Connection extends Stream {
     private final Socket s;
     public final String vhost;
     public Connection(Socket s, String vhost) { super(s); this.vhost = vhost; this.s = s; }
+    public void close()                       { try{s.close();}catch(Exception e){throw new StreamException(e);} super.close(); }
     public int getLocalPort()                 { return s.getLocalPort(); }
     public int getRemotePort()                { return s.getPort(); }
     public InetAddress getRemoteAddress()     { return ((InetSocketAddress)s.getRemoteSocketAddress()).getAddress(); }