We have a process hanging, and the truss shows it also tries to connect but failed with error ECONNREFUSED. The man page says the following, but why it got rejected again and again?
 ECONNREFUSED            The attempt to  connect  was  force-
                         fully  rejected. The calling program
                         should close(2) the socket  descrip-
                         tor,      and      issue     another
                         socket(3SOCKET) call to obtain a new
                         descriptor before attempting another
                         connect() call.
truss -p 2145
/3: lwp_park(0x00000000, 0) (sleeping...)
/2: nanosleep(0xFFFFFFFF7B5FBE60, 0xFFFFFFFF7B5FBE50) (sleeping...)
/2: nanosleep(0xFFFFFFFF7B5FBE60, 0xFFFFFFFF7B5FBE50) = 0
/2: so_socket(PF_INET, SOCK_STREAM, IPPROTO_TCP, "", SOV_DEFAULT) = 17
/2: fcntl(17, F_SETFD, 0x00000001) = 0
/2: connect(17, 0xFFFFFFFF7B5FBF40, 16, SOV_DEFAULT) Err#146 ECONNREFUSED
/2: close(17) = 0
/2: nanosleep(0xFFFFFFFF7B5FBE60, 0xFFFFFFFF7B5FBE50) (sleeping...)
/2: nanosleep(0xFFFFFFFF7B5FBE60, 0xFFFFFFFF7B5FBE50) = 0
/2: so_socket(PF_INET, SOCK_STREAM, IPPROTO_TCP, "", SOV_DEFAULT) = 17
/2: fcntl(17, F_SETFD, 0x00000001) = 0
/2: connect(17, 0xFFFFFFFF7B5FBF40, 16, SOV_DEFAULT) Err#146 ECONNREFUSED
/2: close(17) = 0
/2: nanosleep(0xFFFFFFFF7B5FBE60, 0xFFFFFFFF7B5FBE50) (sleeping...)