def socket(self):
        """Return the socket or ssl object for this client."""
        if self._ssl:
            if self._useSecuredWebsocket:
                return self._ssl.getSSLSocket()
            else:
                return self._ssl
        else:
            return self._sock