-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BSD tcp socket - send error with large data size #276
Comments
Hi @ATrocan, |
Hi @Hnz2, |
Yes, you’re right, but they told me things I had already guessed. Nothing new. |
Hi @ATrocan, |
Hi @Hnz2, My output is after asking in loop for the image to receive(118784 bytes):
As you can see on the 3th send fails, this is the unreliability I was talking about. why did it work the first 2 times and then not? |
Hi @ATrocan, |
Hi @Hnz2 , Alex |
@ATrocan It is possible that your packet pool needs to be much bigger than 32 packets. The BSD layer creates a chain of packets to store the original frame of 119K of data and then passes the chain to the TCP layer. TCP layer attempts to fragment the 119K data into MSS size (assume it is 1460 bytes) and sends each segment to the IP and MAC layer for transmission. Assuming each packet is 1536 bytes, in the worst case you are looking at 158 packets to transmit the 119K payload. |
@ATrocan Not quite... Transmitted TCP frames are queued in the socket, in case the frame needs to be re-transmitted. The frame is released only after an ACK covers the entire frame.
|
Hi,
I use Thread X with RA6M3 (Cortex M4).
FSP version 5.3
I want to send via tcp 119k byte using BSD wrapper, but:
If i try to send with a single call to send() function i get an error.
I thought it was a problem with the number of packet pool and their size but even setting the size to 1568 with 32 packets even trying to send only 15k bytes at a time I get an error.
The only wait to make it to go is to split with small send().
What is the connection with the BSD send() and packet pools?
I thought that BSD send() took care of dividing my data to send it and not having to do it myself. (BSD should take care of this itself, If it can't send all the bytes it should send only those it can but not get an error)
The only limit i think may be space due to the number of packets * packet size, but even if i use 1568 * 32 = 50176 a send with only 15k at a time it should work but it doesn't.
Can you explain to me why?
I think it's a bug, can you check?
Thanks
The text was updated successfully, but these errors were encountered: