This post originated from an RSS feed registered with .NET Buzz
by Steve Hebert.
Original Post: TCPView and Close Connection - how'd he do that?
Feed Title: Steve Hebert's Development Blog
Feed URL: /error.htm?aspxerrorpath=/blogs/steve.hebert/rss.aspx
Feed Description: .Steve's .Blog - Including .Net, SQL Server, .Math and everything in between
On my new project, I've been helping to trace down problems with 3rd party/backend libraries exhibiting bad behaviors.
In tracking down these behaviors, I've been using TCPView to watch connections and see how the application is behaving on the wire. TCPView is a product written by Mark Russinovich and made available at SysInternals.com that interactively displays active TCP connections. If you've never spent an afternoon browsing through the utilities at SysInternals, you are way past due. Russinovich utilities have always had a cool factor where you inevitably go "I didn't know you could do that". In addition to being far more useful than NetStat, TCPView has one feature that is really compelling - "Close Connection".
This function gives me a thought - can I target an application for programmatic 'pulled-wire' testing without having to disconnect the wire on my box?
Mark makes the code for his enhanced version of netstat - which he calls NetStatP - available for free, but he doesn't float up the implementation for Close Connection. All of the other code I have rewritten in C#, now if I could just find Close Connection.... I've been digging in MSDN and Google, but without success.
I wonder if his Close Connection implementation could be used to hound an application and close all of its open connections?