How does a TCP connection close?

[Andreas]: This question is asked in regards to the following FAQ (http://www.dev-archive.com/forum/showthread.php?threadid=364013):

Hi,
I have few questions based on the quotes you made below
When one end decides there is nothing more to send, it sends a 'FIN' packet (a packet with 'FIN' flag on) to the other end. The other end sends an acknowledgement packet ('ACK') for the 'FIN' it received. Once this happens, one way is closed, and the connection is now half open. The other end meanwhile sends all the data if any, and when it is over it sends a FIN packet and this packet is acknowledged. Now the connection is effectively closed and no communication can take place between the end points.

1.
do u mean to say that the side which is sending FIN will be closed after receiving ACK from other end or the opposite ?

2. when the packet is acknowledged for the latter case, who has acknowledged that packet, because already one way is closed isn't it ?
[1045 byte] By [braveYOU] at [2007-11-19 23:16:52]
# 1 Re: How does a TCP connection close?
[ Split thread ]
Andreas Masur at 2007-11-9 13:53:16 >
# 2 Re: How does a TCP connection close?
Say that host A sends a FIN to host B. Host B has two choices.

1.
If B don't want to send anymore data it responds to the FIN with a FIN|ACK. Host A will now respond with an ACK and be put in the TIME_WAIT state. Once host B receives the final ACK the connection is closed for B. Host A will be in TIME_WAIT for 2*MSL (Maximum Segment Lifetime).

2.
Host B wants to send more data so it just responds with an ACK. When it's finished it sends a FIN and the rest is the same as in the previous case.

Here is a tcp state transition diagram
http://www4.informatik.uni-erlangen.de/Projects/JX/Projects/TCP/tcpstate.html
svenhag at 2007-11-9 13:54:16 >