Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #3064
Closed
Open
Issue created Jun 02, 2019 by Administrator@rootContributor

[REQ][Qt5] Optional TimeOut

Created by: luStopai

Is your feature request related to a problem?

Yes

Please describe.

I think Qt5 doesn't manage timeout problems by default. This means that if there is a timeout because of a firewall or an unresponsive server, the connection won't die since there is no mechanism to solve this situation.

Describe the solution you'd like

The usual solution is to set a Qtimer with setsingleshot=true and a timeout, then connect this qtimer timeout() signal to the QNetworkReply abort() slot. If the response happens before the timeout, then the timer has to be stopped. I think you can do this by connecting the finished signal of QNetworkReply to stop slot of the timer, or by calling stop manually when processing the response.

I thought of maybe making the constructor of the generated client depend on an optional timeout with a default value, for example MyConstructor(int timeout = 30). Another option is to set the optional timeout before making a request by using a simple setter.

I've also read about a complementary solution for a similar problem that consists in to combine the use of a qtimer with downloadProgress to check if a download has stopped or is slower than a threshold then abort the connection.

Describe alternatives you've considered

None comes to my mind

Additional context

Assignee
Assign to
Time tracking