async def disconnect(self, expected=True):
        """ Disconnect from server. """
        if self.connected:
            # Unschedule ping checker.
            if self._ping_checker_handle:
                self._ping_checker_handle.cancel()

            # Schedule disconnect.
            await self._disconnect(expected)