How can I detect the first instance of a command-line Dart program to start? -


i want run multiple instances of program command-line , need know first start - need synchronize them. need know subsequent instances not first. ask operator if first-instance, prefer not have that.

can suggest better way handle situation.

detecting if instance of program first instant done using mutex. dart don't have syncronisation methods build in.

an alternative approach using network port on loopback interface. choose fixed port, if instance started, check if can listen on port. if port not available, instance running.

as positive side effect can use connection communicate between instances of application.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -