scala - How do I kill a RemoteActor? -


not sure whether missing something. when making actor remote, main method not terminate.

here snippet demonstrates problem.

 import scala.actors._ import scala.actors.remote._ object testme {   def main(args : array[string]) : unit = {       object jim extends daemonactor {           // comment out these 2 lines , application terminate           remoteactor.alive(12345)           remoteactor.register('jim,this)                    def act {               loop {                   receive {                       case 'quit =>                        println("\nquiting")                         exit('normal)                       case =>                          println(any)                   }               }           }       }       jim.start       jim ! "hello"       jim ! 'quit   } } 

put .alive , .register calls inside act() , code terminates.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -