Pages: 1 [2]   Go Down
Author Topic: EthernetShield + Webserver on a NAS in my LAN  (Read 2758 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
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: 601
Posts: 48569
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: