Ethernet
Ethernet copied to clipboard
TCP Client should allow buffering the outbound packet in w5100 memory. [imported]
From @cmaglie on November 15, 2012 18:39
This is Issue 563 moved from a Google Code project. Added by 2011-06-23T18:16:38.000Z by [email protected]. Please review that bug for more context and additional comments, but update this bug.
Original labels: Type-Enhancement, Priority-Medium, Component-Core
Original description
What change would like to see? Using the standard TCP Client library with the standard Ethernet Shield, every single call to client.write(single_byte) results in an entire frame being constructed and sent. This is terribly inefficient. The underlying socket.cpp library already provides support for starting a packet, adding data, and finally sending the packet, but only for UDP. This should absolutely be available for TCP as well. I would argue that it's even more important for TCP than for UDP.
The problem can be worked around by constructing the entire desired TCP packet in ram first, but this imposes serious restrictions on possible packet size, and completely ignores the 16k of packet buffer memory on the w5100 chip.
While this lack of efficiency is not really a huge problem on a local network, it can dramatically change the network bandwidth required for a sensor node connected over the internet for example.
Would this cause any incompatibilities with previous versions? If so, how can these be mitigated?
I believe they should be extra options. I believe the simplistic existing code is suitable for simplistic use cases, and should be kept, so I do not see any incompatibilities with previous versions.
Copied from original issue: arduino/Arduino#563