Shutdown a connection and then close it