Pages: 1 [2]   Go Down
Author Topic: EthernetShield + Webserver on a NAS in my LAN  (Read 2956 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Faraday Member
**
Karma: 111
Posts: 5255
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Both implementations should produce the exact same output to the server. The println() method adds a carriage return AND newline to the supplied string:

Code:
size_t Print::println(void)
{
  size_t n = print('\r');
  n += print('\n');
  return n;
}

So I don't see the difference...

What version of the IDE are you using?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I use 1.0.1 but the problem (as far as I understand it) is not the request but the server handling it. It seems like println() sends data and line break in seperate packets (whatever "packet" means in this case) whereas print("SOMETHINGSOMETHING\r\n") sends everything in just one packet. Both methods should be fine but the lightttp server seems to get hickups from requests spanning over several packets.
Logged

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

Quote
It seems like println() sends data and line break in seperate packets
This is indeed the case.

Quote
whereas print("SOMETHINGSOMETHING\r\n") sends everything in just one packet.
Also true.
Logged

Pages: 1 [2]   Go Up
Jump to: