Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 2 months ago.
Function recv () does not receive more than 536 bytes
Hi,
Function recv (void *data, nsapi_size_t size) receive data over a TCP socket and returns the number of bytes received in the buffer, but not more than 536 bytes.
See https://os.mbed.com/docs/v5.9/reference/tcpsocket.html
int n = recv(buffer, sizeof(buffer)); How can I receive more than 536 bytes, for example 1460?
Not working
mbed_app.json
{ "target_overrides": { "*": { "target.features_add": ["LWIP"], "lwip.pbuf-pool-bufsize": 1460 } } }
#define TCP_MSS 1460 // not working
Thanks...
1 Answer
6 years, 2 months ago.
This depends on the radio driver, networking stack, etc. Which board are you working on? Just read multiple times until recv returns 0 bytes (or will block error code).