• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I know if a perticular Application gets closed?

 
Samuel Thomas
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an application listening at Port 8470 not wriitten by me.I only know that it is listening at that port.I want to write an application that is always running and will inform me when the other application at 8470 closes.I do not want to always create sockets for checking.
I would appreciate a quick reply
Regards
Sam
samuel@avenir.net
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One method I can think of on Unix or Linix is to Runtime.exec() the ps command grep for the process name and read the input in. I'm not sure how you could do this on Win32. If you can find an exe that will show all running process in the console window, the same process can be used. IMHO using a program to poll the port could be the best way, as long as doing so doesn't cause trouble with the port listener.
I'm going to move this to Advanced, maybe someone there can offer something more.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!