wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes externally close a socket port? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "externally close a socket port? " Watch "externally close a socket port? " New topic
Author

externally close a socket port?

Elhanan Maayan
Ranch Hand

Joined: May 04, 2009
Posts: 112
hi..

is there a command line utility that would allow me to close a specific port a java program is using?

the reason is this, we have a product that for some reason at a specific time of day emits a large number of java.net.SocketException: socket closed, as it's tries to repeatedly to open a connection and fails, after a while the products it self fails to connect to anything.

although we don't know the reason why the socket is closing we would like the ability to re-produce sudden socket close to see what happens on your development environment , while my team leader created a small thread which wakes up every 30 seconds and closes the socket i feel it does not reflect correctly the problem as it's still within the jvm itself which may cause it to act differently, so i'm looking for something similar to tcpview only in command line (no tcpvcons does have such an option).
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Sure, the NETSTAT command lets me do that. At least on the operating system I'm using. You might have had a different operating system in mind -- I can't tell from your post.
Elhanan Maayan
Ranch Hand

Joined: May 04, 2009
Posts: 112
mine is windows 7
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: externally close a socket port?
 
Similar Threads
Networked programing code
Need some advice
event driven socket
Small Question on UnicastRemoteObject
Can I use the same socket to to reconnect after the first connection failed.