This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to support MSG_WAITALL flag for recv() operation

Hi 

We need the recv() be blocking until the full amount of requested data can be returned or the operation was timeout, how to achieve this?

I tried flag MSG_WAITALL but failed to compile with error 'MSG_WAITALL' undeclared;

I also tried flag NRF_MSG_WAITALL but did not work, the recv() also returned the smaller amount of data for first message.

Parents
  • Hello,

    this was fixed a long time ago, so recv should be blocking by default. If it isn't, you should consider updating your NCS repos, and also upgrading the firmware.

  • Hi

    Sorry I cannot find the answer from your link, which flag should I use, MSG_WAITALL or NRF_MSG_WAITALL?

    To obviate misunderstanding, let me explain more about my question:

    1, My TCP client recv() could be blocking untill timeout if TCP server did not send any data;

    2, Conversely, if TCP server sent a part of client requested data before recv() timeout, the client will return the part of data immediately instead of waiting for the whole requested data untill timeout. This is my issue, we need the recv() waiting untill ether it was timeout or the client received the requested complete data.

    SDK: NCS v1.2

    modem: mfw_nrf9160_1.1.1

Reply
  • Hi

    Sorry I cannot find the answer from your link, which flag should I use, MSG_WAITALL or NRF_MSG_WAITALL?

    To obviate misunderstanding, let me explain more about my question:

    1, My TCP client recv() could be blocking untill timeout if TCP server did not send any data;

    2, Conversely, if TCP server sent a part of client requested data before recv() timeout, the client will return the part of data immediately instead of waiting for the whole requested data untill timeout. This is my issue, we need the recv() waiting untill ether it was timeout or the client received the requested complete data.

    SDK: NCS v1.2

    modem: mfw_nrf9160_1.1.1

Children
Related