LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 03-18-2005, 12:44 AM   #1
ust
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 192.168.0.2 to 192.168.0.1 through the port 1186 , but in the host 192.168.0.1 found that the port 1186 is occupied by 192.168.0.2 ( there are three sessions ) , now host 192.168.0.1 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 192.168.0.1 ? thx.



At 192.168.0.1

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

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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:52 AM.

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