W3C home > Mailing lists > Public > www-talk@w3.org > March to April 1996

Re: Receiving requests

From: Simon Spero <ses@tipper.oit.unc.edu>
Date: Sun, 24 Mar 1996 13:30:16 -0800 (PST)
To: Fabien Petitcolas <fapp2@hermes.cam.ac.uk>
Cc: "'www-talk@w3.org'" <www-talk@w3.org>
Message-Id: <Pine.SOL.3.91.960324132704.27765B-100000@chivalry>
On Sun, 24 Mar 1996, Fabien Petitcolas wrote:

> What is the most common way for receiving requests from a browser?
> I tried to use the following code, but the program stops in the loop.
> What's wrong in this way of doing?
> 
> 
> while ((nread = recv(socket, buffer, BUFFER_SIZE, 0))>0)

Typical Fenland community college student :-) 

The reason your code doesn't work is that you're trying to read 
everything up until the end of file, when you really only want to read 
until the end of the first line.

Simon

---
They say in  online country             So which side are you on boys
There is no middle way                  Which side are you on
You'll either be a Usenet man           Which side are you on boys
Or a thug for the CDA                   Which side are you on?
  National Union of Computer Operatives; Hackers, local 37   APL-CPIO
Received on Sunday, 24 March 1996 16:26:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 October 2010 18:14:19 GMT