This task is to determine if there is only one instance of an application running. If the program discovers that an instance of it is already running, then it should display a message indicating that it is already running and exit.

/* Determine if only one instance, in Jsish */
var sock;
 
try {
    sock = new Socket({client:false, port:54321});
    puts('\nApplication running for 30 seconds, from', strftime());
    update(30000);
    puts('\nApplication ended at', strftime());
} catch (err) {
    puts('Applicaion already running');
    exit(1);
}