It might be sleeping if for example it's an heroku free tier that hasn't been used for some times. Therefore the first query will have to wait for the server to awaken thus it will be longer.
It might require authentication which takes some time on first query to setup and allow to process.
It might need to query some slow to start resource to answer your question
Oh, I see. Well it is not a my server, it is a thirdy party server, so I can't answer to all that question. All I know is:
It is hosted on akamai.com
Acqtually it require some authentication data that I give with POST data
So I think I can't optimize requests server side, all can I do is caching DNS/TCP/SSL requests but I don't know if Qt 5.11.2 actually implements all that suggestions
By default QDataStream uses big endian. You can change it manually, but do so on all platforms you want to deploy to/programs you're deploying. In any case you're fine as long as you stream your data with the appropriate operators and don't use writeRawData/readRawData or any reinterpret_cast "tricks".
Here you can find a threaded TCP server example. You can ignore the module specific classes QDaemonApplication (think of it as QCoreApplication) and QDaemonLog you can substitute with QDebug.
Let's not do that. Let's call them a server and a client - it's much better and easier to follow the accepted terminology. A server will serve the requests presented by the clients (see the analogy with a busy restaurant?).
There can only be one "controller", but the number of "nodes" may vary (eg. different clients).
So you have one server and a few clients. So far so good.
I want to have the "controller" initiate the connection to each client such that arbitrary data is sent back and forth as it is ready (readyRead() signal? ).
How data flows between the client and the server is completely independent of who initiated the connection. You can still have the server sending data to the clients (what http servers mostly do), and still the client initiates the connection (i.e. your browser).
I have implemented the Fortune Client/Server example with the "controller" as the Client (since it would initially ask for a connection), and the Fortune Server as a test (eventually it would be a "node" sending data). This is where I'm stuck. Ignoring less-than-critical performance issues, how would I modify the Fortune example (or perhaps roll my own) to allow the Server to accept data from the "controller" without the use of any buttons/etc, but to get it as it is "ready"? Ideally, this needs to scale up to a max of 15 "nodes".
Just write from the appropriate side (application). The server should stay the server, and the client should stay a client, don't switch their roles.
I never tried to start a thread with event loop in a program without main event loop (QApplication). My guess: it will work inside your thread, but you will not be able to communicate with the thread from main thread using signals/slots.