Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-18-2005, 12:44 AM   #1
Senior Member
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
terminate the connection

I am running some program that connect from to through the port 1186 , but in the host found that the port 1186 is occupied by ( there are three sessions ) , now host can't connect one more session , it may be because the max. limit of session is full , can suggest how to erase this "CLOSE_WAIT" connection at ? thx.


# netstat -na |grep 1186
tcp 0 0* LISTEN
tcp 1 0 CLOSE_WAIT
tcp 1 0 CLOSE_WAIT
tcp 1 0 CLOSE_WAIT
Old 03-19-2005, 10:07 AM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,289

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
IIRC the kernel actually holds connections open after the connections close for some reason (there is a reason for it, but I can't remember off the top of my head). One way to get around it is use setsockopt(2) in your program and set the SO_REUSEADDR option on the socket. Otherwise maybe there's a sysctl that controls this, but looking through them I didn't see anything offhand.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to gracefuly terminate a Samba connection. unreal128 Linux - Networking 1 07-06-2005 09:23 PM
How to terminate X application? drj000 Linux - Software 1 02-10-2005 07:40 PM
how to terminate processes feetyouwell Programming 8 09-18-2004 02:27 PM
How can I terminate an application? yangyiqi Linux - Software 7 12-10-2003 06:39 PM
jvm won't terminate beccala33 Linux - Newbie 0 05-14-2002 11:57 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration