src/wiotp/sdk/client.py
def connect(self):
        """
        Connect the client to IBM Watson IoT Platform using the underlying Paho MQTT client
        
        # Raises
        ConnectionException: If there is a problem establishing the connection.
        """
        self.logger.debug(
            "Connecting... (address = %s, port = %s, clientId = %s, username = %s)"
            % (self.address, self.port, self.clientId, self.username)
        )
        try:
            self.connectEvent.clear()
            self.client.connect(self.address, port=self.port, keepalive=self.keepAlive)
            self.client.loop_start()
            if not self.connectEvent.wait(timeout=30):
                self.client.loop_stop()
                self._logAndRaiseException(
                    ConnectionException(
                        "Operation timed out connecting to IBM Watson IoT Platform: %s" % (self.address)
                    )
                )

        except socket.error as serr:
            self.client.loop_stop()
            self._logAndRaiseException(
                ConnectionException("Failed to connect to IBM Watson IoT Platform: %s - %s" % (self.address, str(serr)))
            )
def connect(self):
        """
        Connect the client to IBM Watson IoT Platform using the underlying Paho MQTT client
        
        # Raises
        ConnectionException: If there is a problem establishing the connection.
        """
        self.logger.debug(
            "Connecting... (address = %s, port = %s, clientId = %s, username = %s)"
            % (self.address, self.port, self.clientId, self.username)
        )
        try:
            self.connectEvent.clear()
            self.client.connect(self.address, port=self.port, keepalive=self.keepAlive)
            self.client.loop_start()
            if not self.connectEvent.wait(timeout=30):
                self.client.loop_stop()
                self._logAndRaiseException(
                    ConnectionException(
                        "Operation timed out connecting to IBM Watson IoT Platform: %s" % (self.address)
                    )
                )

        except socket.error as serr:
            self.client.loop_stop()
            self._logAndRaiseException(
                ConnectionException("Failed to connect to IBM Watson IoT Platform: %s - %s" % (self.address, str(serr)))
            )
def connect ( self ) : self . logger . debug ( "Connecting... (address = %s, port = %s, clientId = %s, username = %s)" % ( self . address , self . port , self . clientId , self . username ) ) try : self . connectEvent . clear ( ) self . client . connect ( self . address , port = self . port , keepalive = self . keepAlive ) self . client . loop_start ( ) if not self . connectEvent . wait ( timeout = 30 ) : self . client . loop_stop ( ) self . _logAndRaiseException ( ConnectionException ( "Operation timed out connecting to IBM Watson IoT Platform: %s" % ( self . address ) ) ) except socket . error as serr : self . client . loop_stop ( ) self . _logAndRaiseException ( ConnectionException ( "Failed to connect to IBM Watson IoT Platform: %s - %s" % ( self . address , str ( serr ) ) ) )
Connect the client to IBM Watson IoT Platform using the underlying Paho MQTT client
        
        # Raises
        ConnectionException: If there is a problem establishing the connection.
Connect the client to IBM Watson IoT Platform using the underlying Paho MQTT client # Raises ConnectionException : If there is a problem establishing the connection .