  We report a numerical study of the shear viscosity and the frequency
dependent elastic moduli close to dynamical arrest for a model of short-range
attractive colloids, both for the repulsive and the attractive glass
transition. Calculating the stress autocorrelation functions, we find that
density fluctuations of wavevectors close to the first peak in the structure
factor control the viscosity rise on approaching the repulsive glass, while
fluctuations of larger wavevectors control the viscosity close to the
attractive glass. On approaching the glass transition, the viscosity diverges
with a power law with the same exponent as the density autocorrelation time.
