Solaris 7 socket cleanup

Solaris 7 socket cleanup

Post by B » Fri, 04 Oct 2002 03:08:42



I have a program that crashes and leaves TCP sockets* around.

If I run netstat I see these connections with states of ESTABLISHED
and CLOSE_WAIT.

When I try to rerun my prpogram I can no longer make the connections I need
because they appear to be hung up.

How can I clean this up without rebooting my computer? Are their any
commands I can use at the command line to shut these connections down?

 
 
 

Solaris 7 socket cleanup

Post by Joe Blogg » Fri, 04 Oct 2002 04:30:17



Quote:> I have a program that crashes and leaves TCP sockets* around.

> If I run netstat I see these connections with states of ESTABLISHED
> and CLOSE_WAIT.

> When I try to rerun my prpogram I can no longer make the connections I
need
> because they appear to be hung up.

> How can I clean this up without rebooting my computer? Are their any
> commands I can use at the command line to shut these connections down?

Perhaps try cranking down tcp_time_wait_interval with ndd -set /dev/tcp
tcp_time_wait_interval (value)

 
 
 

Solaris 7 socket cleanup

Post by Casper H.S. Di » Fri, 04 Oct 2002 18:32:15



>I have a program that crashes and leaves TCP sockets* around.
>If I run netstat I see these connections with states of ESTABLISHED
>and CLOSE_WAIT.

If the program crashes then the endpoints cannot be in ESTABLISHED or
CLOSE_WAIT state; at best they can be in time wait:

        CLOSE_WAIT: connection shutdown; but one side still has fd open
        ESTABLISHED: connection alive and kicking: both sides have it open.

Only TIME_WAIT connections clear up without intervention (in around 4 minutes
by default)

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

1. Socket cleanup in Solaris

Date: 15 Apr 1996 15:10:12 -0400

Organization: ANS, Reston VA
Lines: 15
X-Newsreader: Gnus v5.0.12

I'm looking for a program that will cleanup sockets
that get stuck in a FIN_WAIT_[12] or CLOSE_WAIT state.

Occasionally I find sockets that the kernel recognizes as
being active, but have nothing actually holding them open
on either end.   The result is that I have to wait an
unacceptably long period of time (5 minutes or more, sometimes
a reboot is necessary) to be able to reuse the port that
they were using.  SO_REUSEADDR is not acceptable for this
application and will not necessarily solve the problem anyway.

Any suggestions/pointers would be greatly appreciated.

-wyllys-
--

------------------------------------------------------------
Wyllys Ingersoll                      Interlock Developer

Reston, VA
------------------------------------------------------------

2. zmodem/telnet

3. how to cleanup socket port after the server broke the connection

4. ZFS - having inodes + log on seperate disk ?

5. Poor socket cleanup on SunOS 4.1.x

6. Problems with tulip.c

7. signal cleanups continued: cleanup do_signal

8. AHA1542CF Adapter problems

9. [CLEANUP] task->state cleanups part 9

10. [CLEANUP] task->state cleanups part 7

11. [CLEANUP] task->state cleanups part 6

12. [CLEANUP] task->state cleanups part 3

13. [CLEANUP] task->state cleanups part 4