Complete.Org: Mailing Lists: Archives: gopher: March 2002:
[gopher] Re: \n.\n
Home

[gopher] Re: \n.\n

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: gopher@xxxxxxxxxxxx
Subject: [gopher] Re: \n.\n
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: Wed, 20 Mar 2002 20:11:04 -0500
Reply-to: gopher@xxxxxxxxxxxx

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



[Prev in Thread] Current Thread [Next in Thread]