Shutdown server

def close(self):
        """Shutdown server"""

        try:
            self.conn
        except AttributeError:
            pass
        else:
            self.conn.send_bytes(dumps(('close', (), {}), 2))
            self.conn.close()
            del self.conn