Results 1 to 15 of 15

Thread: QNetworkAccessManager help needed! Class problem...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QNetworkAccessManager help needed! Class problem...

    Quote Originally Posted by TCB13 View Post
    I'll have to do this type of "checkpoints" when the server starts, a client connects and more other places.. and I don't want to have my QT server interacting directly with my MySQL db.
    That's ok. But your code doesn't need to be synchronous.

    If I throw the rest of the tcpserver start in another slot I'll be like "breaking" my program in more parts
    That's a good thing.
    and I'm adding more complexibility to this.
    No, that's only your impression. Look at it that you simplify each step of the process by limiting it to a short sequence of operations.

    Because usually in C and my AVR/PIC stuff I'm used to run one thing at the time and call a function to do something and the periodically run checks to see if the sockets are still ok and stuff like that. Here it's like everything is happening at the same time..
    Yes. You are used to synchronous approach and here is an asynchronous approach. Synchronous approach wastes too much resources, asynchronous is better (however it seems more complicated if you're not used to it).

    Also, each time I will need to do something on the server I will need to "split" the current function into two in order to implement the slot/signal thing.
    That's not entirely correct but it is better to stick to such approach if you don't feel confident with Qt. One method triggers a request and another handles the response. You can write a simple dispatcher method that will handle all responses by calling appropriate methods.

    And.. if a client sends a message that I haven't already checked in the DB he will be able to send another and it will be processed right way.
    It depends how you implement it. The proper approach would be to block the user interface for the duration of executing the request.
    I'm usually more comfortable with the "one thing at a time" approach.
    Unfortunately it makes your user interface freeze and there is no way to abort an already running request.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. The following user says thank you to wysota for this useful post:

    TCB13 (28th August 2011)

Similar Threads

  1. Replies: 8
    Last Post: 19th April 2011, 08:17
  2. QNetworkAccessManager problem instantiating
    By hojoff79 in forum Qt Programming
    Replies: 8
    Last Post: 9th February 2011, 05:59
  3. Replies: 7
    Last Post: 2nd September 2010, 20:42
  4. qnetworkaccessmanager problem!
    By novamaster in forum Qt Programming
    Replies: 6
    Last Post: 7th August 2010, 12:46
  5. help needed to write a render class
    By franco.amato in forum Qt Programming
    Replies: 9
    Last Post: 1st June 2010, 23:07

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.