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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -