Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Losing connection
Forum Updated to NodeBB v4.3 + New Features

Losing connection

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.8k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    ThaRez
    wrote on last edited by
    #1

    Hello
    I'm sending data using Post over http (SOAP), and my issue is that if the connection is interrupted and the software tries to send data during this time, it won't restore. Else if the connection has time to restore (heal) everything continues to work just fine. The same applies to restarting the application, also then does everything again start to work.

    I guess that a request somehow remains active, thereby messing up the connection. My object has a "QNetworkAccessManager" that handles the request, also an QNetworkRequest and an QNetworkReply are included in the object. Every time I issue a post request:

    @this->soapTimeReply = soapTimeManager->post(*soapTimeRequest,content);@

    I also issue a timeout:

    @this->timeoutTimer->setSingleShot(true);
    this->timeoutTimer->start(TIMEOUT_SOAP);@

    with the timeout function as follows:

    @void Mailman::transferTimeout()
    {
    if(soapReply->isRunning())
    {
    soapReply->abort();
    }
    }@

    The abort function calls the finished slot of the request, which then retries to send the request:

    @if (doneReply->error() == QNetworkReply::NoError)
    {
    qDebug() << "Transfer OK!";
    }
    else
    {

        soapReply = soapManager->post(*soapRequest,content);
    

    this->timeoutTimer->setSingleShot(true);
    this->timeoutTimer->start(TIMEOUT_SOAP);
    }
    }@

    Unfortunately this always ends up in a timeout... As mentioned, as long as all requests are sent when the connection is working (doesn't matter if it's broken in between) everything works. But as soon as a single request is sent when the connection is down, it jams, and isn't restored until I reboot the application...

    What could be causing this? Thank you!
    Richard

    1 Reply Last reply
    0
    • A Offline
      A Offline
      apinho
      wrote on last edited by
      #2

      I am having this same problem using gSOAP to connect to a webservice. I am using Symbian S60 3rd Edition FP2 with Qt. The application runs fine, but after an hour or so gsoap stops being able to connect to the WS. If I restart the application it starts running fine. Any clue?

      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