Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QSslSocket blocks webserver response delivery
Forum Updated to NodeBB v4.3 + New Features

QSslSocket blocks webserver response delivery

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 168 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    curunir
    wrote on last edited by
    #1

    I am building an IoT device which uses MQTT over SSL and during setup the user opens an access point and python flask webserver to configure the device. The main application is written with Qt (5.12.3) and maintains the MQTT connection. The application continously tries to establish connection to the broker if no ping was received for 15 seconds. The restablishing of the connection is done like this (for brevity sake I removed the setup stuff):

                m_ssl_socket->disconnectFromHost();
                m_ssl_socket->abort();
                m_ssl_socket->connectToHostEncrypted(Config::getMqttEndpoint(), Config::getMqttPort());
                m_ssl_socket->waitForEncrypted(1000);
                if(m_ssl_socket->isEncrypted() && m_mqtt_client){
                    m_mqtt_client->connectToHostEncrypted();
                }
    

    I can see that the python webserver stops responding when the m_ssl_socket changes into the HostLookupState. This state is maintained for an unusal long time >20 seconds if the device has no internet connectivity and the lookup fails. Is there a way to setup a timeout for the hostlookup? I could not find anything on the QSslSocket class and the QAbstractSocket. Reading the source code of QtBase left me more confused then before.

    I am working on providing a full minimal example.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved