This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BSD recv() with RTX

I am trying to understand the recv(),  it is stated that:

" In blocking mode, which is enabled if the system detects RTX environment, this functions waits for received data.

The argument buf is a pointer to the application data buffer for storing the data to. If the available data is too large to fit in the supplied application buffer buf, excess bytes are discarded in case of SOCK_DGRAM sockets. For socket types SOCK_STREAM, the data is buffered internally so the application can retrieve all data by multiple calls of recv function.

The argument len specifies the size of the application data buffer. "

If I make the size of buf = 16384 and use SOCK_STREAM.  Then the client sends a message with the equivalent size.  Will the recv() blocks until it receives the whole message or I have to call the recv() multiple times?

I have read that the maximum segment size is 1440 and the receive window size is 4320.  Our data is greater than the maximum segment size and receive window size.  

  • Hello darwinu,

    Only the following flags are supported in recv(), defined in RTL.h:

    /* BSD Socket flags parameter */

    #define MSG_DONTWAIT 0x01  /* Enables non-blocking operation          */

    #define MSG_PEEK 0x02  /* Peeks at the incoming data */

    The flag MSG_WAITALL is not supported, so the recv() returns when the data is received or when timeout expires. If the buffer size is 16384, the user needs to call recv() multiple times.

    Kind regards,

    Christopher