LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-17-2007, 12:15 PM   #1
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Rep: Reputation: 30
command to close tcp socket


After the server is stopped, the tcp port 1864 is still listening (a bug in the server), is there an unix command to close the socket.

# netstat -na
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 172.20.11.242:1864 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 172.20.11.242:22 172.20.11.211:32877 ESTABLISHED
tcp 0 0 172.20.11.242:22 172.20.10.119:32789 ESTABLISHED
tcp 0 0 172.20.11.242:22 172.20.11.211:32878 ESTABLISHED
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 902 /var/run/acpid.socket
unix 10 [ ] DGRAM 741 /dev/log
unix 2 [ ] DGRAM 8305323
unix 2 [ ] DGRAM 1500912
unix 2 [ ] DGRAM 705953
unix 2 [ ] DGRAM 11894
unix 2 [ ] DGRAM 1172
unix 2 [ ] DGRAM 999
unix 2 [ ] DGRAM 946
unix 2 [ ] DGRAM 753
unix 2 [ ] STREAM CONNECTED 433
 
Old 08-17-2007, 12:22 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
if the server is really stopped, how can the port still be listening? Correct me if I'm wrong, but I didn't think a program could still be bound to a port after it is killed.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I force a TCP port to close Ratclaws Linux - Networking 2 09-06-2005 02:36 PM
race condition in close socket?? jwstric2 Programming 3 03-18-2005 05:01 PM
tcp socket monitoring xuttux Linux - Networking 1 05-19-2004 08:49 AM
Close socket/port THETEZ Linux - General 4 03-28-2004 08:05 PM
close port 6000/tcp 515/tcp SchwipSchwap Linux - Newbie 1 09-12-2002 08:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:14 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