Even though too much of CLOSE_WAIT connections means there is something wrong with your code in the first and this is accepted not good practice.
You might want to check out: https://github.com/rghose/kill-close-wait-connections
What this script does is send out the ACK which the connection was waiting for.
This is what worked for me.