[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[gopher] Re: \n.\n



On Wednesday, March 20, 2002, at 04:51  PM, Robert Hahn wrote:

> I would fully support this if you can explain to me how a gopher
> client is supposed to 'know' when the end of a file is and closes the
> connection.

Well, this capability is built into the TCP implementation of the 
operating system.  Specifically, to read data from the network, you use 
the read(2) system call.  This system call returns a code indicating how 
much data was actually available to read -- or a code indicating that 
the other side has finished transmitting and has closed the connection 
(among others).  A client can simply use the return value from read() to 
figure out when the file is finished.  Note that other protocols such as 
HTTP/1.0 and FTP (data) work exactly this way.

So, \n.\n is not really needed at all in gopher.

-- John



Reply to: