kill a tcp ip connection in windows (XP)

tgkprog

Member
Messages
226
Reaction score
0
Points
16
i can see a list of TCP connection via netstat but do u know of a way to forecefully close/ end a connection?

Code:
C:\>netstat

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    TGK1:1451              localhost:1452         ESTABLISHED
  TCP    TGK1:1727              x10hosting.com:http    CLOSE_WAIT
  TCP    TGK1:1730              207.211.65.15:http     CLOSE_WAIT
  TCP    TGK1:1733              im-in-f127.google.com:http  CLOSE_WAIT
 

Armacci Design

New Member
Messages
38
Reaction score
0
Points
0
If you can't close the specific connection for some reason, I would suggest reviewing your firewall's allow/disallow program rules, and prohibit everything that you aren't explicitly familiar with from connecting.
 

vol7ron

New Member
Messages
434
Reaction score
0
Points
0
The CLOSE_WAIT states are already terminated from the foreign end - your machine received the "FIN" packet. The reason it appears as open is that your OS still needs to terminate the local application that is performing the connection.

So, once the application realizes the socket is closed, it will send it's FIN and free the socket. This is natural to have lingering CLOSE_WAITs. After the CLOSE_WAIT loop, you'll enter the TIME_WAIT cycle.

If your CLOSE_WAIT is being held open, it is most likely a problem with the application. Try killing the application through Windows Task Manager. Or use "ps" and "kill" in your command program to kill the process that is holding the connection open.
 
Last edited:

Smith6612

I ate all of the x10Pizza
Community Support
Messages
6,518
Reaction score
48
Points
48
A CLOSE_WAIT state as stated above is perfectly normal. If you are concerned about where connections are going, firewalls and router NAT logs are useful for such things. Also, killing a process of a program should close the connection. If worst comes to worst, you can always kill a connection by timing it out by disconnecting the internet.
 

tgkprog

Member
Messages
226
Reaction score
0
Points
16
yes closing the net is a quick way. i wanted to closed some of the tcps cause i had a lot of congestion i was hopeing i can do it without going to every tab in the browsers (opera and IE) and closing ...
Edit:
there must be some windows api to close it - any VB/ c++ folks?
 
Last edited:
Top