That's ok. But your code doesn't need to be synchronous.
That's a good thing.If I throw the rest of the tcpserver start in another slot I'll be like "breaking" my program in more parts
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.and I'm adding more complexibility to this.
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).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..![]()
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.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.
It depends how you implement it. The proper approach would be to block the user interface for the duration of executing the request.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.
Unfortunately it makes your user interface freeze and there is no way to abort an already running request.I'm usually more comfortable with the "one thing at a time" approach.






Reply With Quote

Bookmarks