[172] in 6.033-lab
Re: tcp proxy
daemon@ATHENA.MIT.EDU (Benjie Chen)
Sun Feb 20 19:10:18 2000
From: Benjie Chen <benjie@cag.lcs.mit.edu>
Message-Id: <200002210010.TAA21112@amsterdam.lcs.mit.edu>
To: 6.033-lab@MIT.EDU
Date: Sun, 20 Feb 2000 19:10:06 -0500 (EST)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
> shutdown command. My understanding is that shutdown should be used when an
> EOF is read, right? If the proxy gets an EOF when reading data from the
> client, then it shoudl shutdown reading from the client connection and
> shutdown writing to the server, right? Is it necessary to call close on a
> socket even if you have already used shutdown to shutdown both directions
Hi all
When you receive an EOF on read, you want to shutdown the read, but you
want to becareful with the writing side. You want to think about when you
want to propagate the EOF and shutdown the write.
Shutdown both directions is not the same thing as a close. A close(fd)
additionally frees up the descriptor, whereas if you just shutdown(fd,2),
you can still do ioctl or getsockopt with the descriptor.
Benjie
--
Benjie Chen
benjie@lcs.mit.edu