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. QNetworkAccessManager Wrapper

QNetworkAccessManager Wrapper

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.5k 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.
  • E Offline
    E Offline
    elmigranto
    wrote on last edited by
    #1

    I'm writing a program that relies on client-server communication (about 10 lightweight requests per minute). We're using JSON API over HTTP. Client is written in C++/Qt.

    Since I'm kind of Junior, I've been looking for example or guide on using QNetworkAccessManager (not help on API, but real-world example) for couple of weeks. No luck in googling such thing. Finally, I've written my own buggy wrapper. After awhile, it's rewritten in simpler and cleaner way (from my POV).

    I hope someone will review my code and point to weak spots. Maybe some advice on class structure or coding style?
    Code is available on bitbucket: https://bitbucket.org/elmigranto/qnamwrapper/src

    Also, there is a bug related to QNAM limitation (max 6 connections to host:port). I can't find a way for starting timer with actual request start (not just creating). Pointing in right direction about that could also be great. Is there any related signal, maybe?

    Any ideas on how to achieve thread-safety?

    Any feedback is appreciated.
    Thanks.

    upd
    Kind of dropped project, will reconsider in future.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sidewinder
      wrote on last edited by
      #2

      Hello,
      I use "QAbstractSocket::stateChanged(...)":http://qt-project.org/doc/qt-4.8/qabstractsocket.html#stateChanged signal to get socket state changes in addition to other signals like error, readready etc.

      "Never memorize what you can look up in books."
      Albert Einstein

      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