• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

close the application completely(urgent)

 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My problem is I have two classes, one to receive a message continuously i.e. while(true) loop, whenever that socket(port) is contacted.I run the sending file in a nother window. I run a single bathc file to do so.
source:[run.bat]
-----------------------------------------------------------------
javaw send
javaw receive
-----------------------------------------------------------------The send program places a system tray.Now when I close the application from the tray, I find the receive program running(by prssing ctrl+alt+del) in windows.So how can I exit this application completely.I tried by calling a method in receive which contains
"System.exit(0);",the method is called from send,but the program is still running.
Instead if I create an instance of "receive" in "send" i.e. to run in a single window,the receive program is not contacted.So please help me out to solve this problem,It's breaking my heads.Please reply as soon as possible.
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the other is a Thread, instead of while(true) use while(some variable set to true). When you want it to end set it to false and the run method will end along with the thread.
 
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic