Just had an instance where we moved over an application from one server to another and there was a big jump in PHP versions from one server to another. We noticed websites hanging on a particular page. By adding exit; to the code we determined it was a call to pgpcrypto that was causing the hanging on the page.
This lead to us noticed a bunch of CLOSE_WAITS on the system so hence the blog post. I found a great explanation here (http://j2eedebug.blogspot.com/2008/12/difference-between-closewait-and.html) of what I am going to describe below.
What it basically says is a CLOSE_WAIT state is when a socket is waiting for an application to call close() on the socket. Could be some type of error in the code. A TIME_WAIT is a defined value on a system that just says wait 2*MSL (Maximum Segment Lifetime) of time and then close the connection.
Below is a display of the close steps for a TCP connection.