Pages: [1]   Go Down
Author Topic: How big is the Ethernet Client Read Buffer?  (Read 1245 times)
0 Members and 1 Guest are viewing this topic.
Seattle, WA
Offline Offline
Full Member
***
Karma: 0
Posts: 194
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm wondering how big the ethernet client read buffer is and what happens if you don't read it fast enough?  Does it overflow, dump and restart?  

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The types.h file in the Ethernet library contains this:
Code:
#define TX_RX_MAX_BUF_SIZE      2048
So, it looks like the transmit and receive buffers are 2048 characters long. Once the receive buffer is full, data is discarded.
Logged

Seattle, WA
Offline Offline
Full Member
***
Karma: 0
Posts: 194
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why isn't it the full 8k?  That is what the W5100 has for the rx, 16kb total with tx buffer.  Why was 2k chosen?  
Logged

Seattle, WA
Offline Offline
Full Member
***
Karma: 0
Posts: 194
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I bumped it up to 3078 (added 1024) to it and it looks like it fixes my issues!   Does anyone know why 2048 limit was set?   I'd like us to use the full 8kb buffer if possible?
Logged

Seattle, WA
Offline Offline
Full Member
***
Karma: 0
Posts: 194
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

P.S. Who are the founding fathers of the ethernet shield code?  I'd like to really know what the logic was surrounding the 2048 limit... it's not commented very well (not at all) so it's hard to figure out the reasoning.
Logged

Seattle, WA
Offline Offline
Full Member
***
Karma: 0
Posts: 194
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually... when I check client.available I still get 2048... how do I change it to something bigger?
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6634
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As a guess, it's because the chips supports four simultaneous connections...
Logged

Pages: [1]   Go Up
Jump to: