public void close () throws IOException
    {
	in = null;
	out = null;
	
    	if (random != null) {
	    random.close ();
	    random = null;
	} else if (socket != null) {
	    socket.close ();
	    socket = null;
	}
    }