3 ms·
It's explained further down: After the last byte of the file is sent, the nweb web server web() function stops for one second. This is to enable the file conte
by Pitarou 13y ago
It's explained further down:
After the last byte of the file is sent, the nweb web server web() function stops for one second. This is to enable the file contents to be sent down the socket. If it immediately closes the socket, some operating systems do not wait for the socket to finish sending the data but drops the connection very abruptly. This would mean that some of the file content would not get to the browser, and this confuses the browser by waiting forever for the last bit of the file and often results in a blank web page being displayed.
- stefs 13y agoah, sorry - i just read a part and ctrl+f'd for this, but searched for the wrong terms apparently. would this cause connection timeouts if copying data to the socket took longer than one second? i'm always a bit sceptical when i encounter such seemingly arbitrary timing assumptions.
- kragen 13y agoThis text has an error rate of about one factual error per sentence, as you'd expect from someone who capitalizes "Linux" as if it were an acronym.
- Pitarou 13y agoWe're definitely in "works on my machine" territory here. Still it's good for building your confidence as a programmer, no?