locked
StoreAsync & FlushAsync

    Question

  • Hi,

    In C++ socket sample i see this code, i have some questions about how this work

    // Write the locally buffered data to the network.
    task<unsigned int> store(writer->StoreAsync());
    store.then([socket] (unsigned int)
    {
        return socket->OutputStream->FlushAsync();
    }).then([this, stringToSend] (task<bool> flushTask)

    the first task<unsinged int> , is this value the amount of that send? can this size differ from the bytes written to the Writer?

    Is required to call FlushAsync in OutputStream, or is this only required for wait the data being send?

    Thursday, May 10, 2012 2:28 PM

Answers

  •  

    Hello,

     

    I tested some codes and I found that the unsigned int return by StoreAsync function is the length of store data.

     

    The FlushAsync function is used for Flush stream, it is the same as ostream::flush function.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by pepone.onrez Friday, May 11, 2012 11:26 AM
    Friday, May 11, 2012 6:52 AM