Are you sure the connection is fully closed? When you close a tcp connection, it stays in time_wait and fin_wait for a while, during which time the port can't be reused. You said netstat doesn't show anything on that port?