1 package javagroup.disposer; 2 3 import javagroup.util.Disposable; 4 5 import java.io.IOException; 6 import java.net.Socket; 7 8 public class SocketDisposer implements Disposable { 9 10 protected Socket _socket; 11 12 public SocketDisposer(Socket socket) { 13 _socket = socket; 14 } 15 16 public void dispose() { 17 try { 18 _socket.close(); 19 } catch (IOException e) { 20 } 21 } 22 23 } 24 25