Any tricks to let client know Enginio is ready?



  • I am developing a small App that wants to popup a user interface that informs user the Enginio backend ( network ) is ready ( connected ) and thus user can upload their private data to Enginio backend. How to achieve the goal?
    By the way, I am using Enginio QML library, the target devices are PCs and Android Phones.



  • What do you mean by "connected" ? If the network is up, the server is (should) be always "ready" to respond to requests ...



  • it ought to work as TCP three hand shake. I want to send a message to server to establish a hand-shake so that the client knows that the server is ready.
    [quote author="gadlim" date="1400273592"]What do you mean by "connected" ? If the network is up, the server is (should) be always "ready" to respond to requests ...[/quote]



  • bq. I want to send a message to server to establish a hand-shake so that the client knows that the server is ready.

    But the server is always ready. I don't understand the need for a TCP handshake. You can use a user authentification request to check the user credentials if it's a private access, but other than that there should no be any prior exchange before the actual data uploading.
    Perhaps I'm missing something, I'm only a lab rat...



  • Gadlim is right, you can use EnginioClient immediately.



  • Thank you! I am using that, the EnginioClient works good however whetn I use client.create function, the reply indicate the success or failure of this insertion goes in onFinished signal handler not the return value of client.create function.
    I suggest not setting the return value of client.create function. In other words return nothing.



  • Correct, a reply returned by EnginioClient is just a wrapper around future value returned from the server. Only after finished signal is emitted we know that the reply was finished, which means that it contains an interesting data (assuming no error).

    Even for create function the reply may be interesting because it contains additional information about the newly created item, like for example id. Moreover returning a reply simplifies handling of certain operations, for example if you need to printout a confirmation message that an object was uploaded, it is much simpler to connect directly to the finished signal of the reply instead of doing manual dispatching in EnginioClient onFinished.



  • Thanks, I 've met a small problem, how to distinguish a reply triggered by client.create function and those triggered by client.update function?
    [quote author="Nierob" date="1400510131"]Correct, a reply returned by EnginioClient is just a wrapper around future value returned from the server. Only after finished signal is emitted we know that the reply was finished, which means that it contains an interesting data (assuming no error).

    Even for create function the reply may be interesting because it contains additional information about the newly created item, like for example id. Moreover returning a reply simplifies handling of certain operations, for example if you need to printout a confirmation message that an object was uploaded, it is much simpler to connect directly to the finished signal of the reply instead of doing manual dispatching in EnginioClient onFinished.[/quote]



  • Where / why do you need to do it? I guess this is not good enough for you:

    EnginioReply *createReply = client->create(...);
    EnginioReply *updateReply = client->update(...);


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.