Use close instead of shutdown.