0 means that the connecgtion will wait indefinitely to timeout. Since you are having problems, you want to set this value to something like 5 minutes (600000).
$ ndd -h tcp_fin_wait_2_timeout
tcp_fin_wait_2_timeout:
Determines how long a TCP connection will be in FIN_WAIT_2.
Normally one end of a connection initiates the close of its end
of the connection (indicates that it has no more data to send) by
sending a FIN. When the remote TCP acknowledges the FIN, TCP
goes to the FIN_WAIT_2 state and will remain in that state until
the remote TCP sends a FIN.
If the FIN_WAIT_2 timer is used, TCP will close the connection
when it has remained in the FIN_WAIT_2 state for the length of
the timer value.
The FIN_WAIT_2 timer must be used with caution because when TCP
is in the FIN_WAIT_2 state the remote is still allowed to send
data. In addition, if the remote TCP would terminate normally
(it is not hung nor terminating abnormally) and the connection is
closed because of the FIN_WAIT_2 timer, the connection may be
closed prematurely. Data may be lost if the remote sends a
window update or FIN after the local TCP has closed the
connection. In this situation, the local TCP will send a RESET.
According to the TCP protocol specification, the remote TCP
should flush its receive queue when it receives the RESET. This
may cause data to be lost.
[0-2147483647 Milliseconds] Default: 0 (indefinite)
Remember, wherever you go, there you are...