Quote Originally Posted by wysota View Post
No, it's not, you just have to change the way you think.
Ok, then so help me here a little with logic...

Quote Originally Posted by wysota View Post
It doesn't mean your program has to "wait" before "returning to the tcpserver class". Especially since you're in a constructor.

No, you don't. You only need to execute code B after code A is complete. It doesn't mean you have to wait for anything.

Why not? - "throw the rest of the program in a new custom slot and activate it by a signal..."
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.

If I throw the rest of the tcpserver start in another slot I'll be like "breaking" my program in more parts and I'm adding more complexibility to this. 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..

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. Or can I do that all on the http2 side and leave everything on the tcpserver like it is? - How?

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. I'm usually more comfortable with the "one thing at a time" approach.

Quote Originally Posted by wysota View Post
It won't work. You don't have an event loop running, no networking operations can ever complete this way.
Got it

Thanks.