Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

externally close a socket port?

 
Elhanan Maayan
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21133
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mine is windows 7
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic