Determine if only one instance is running: Difference between revisions

Line 575:
}
}</lang>
 
=={{header|Julia}}==
{{trans|Java}}<lang julia>
using Sockets
 
const portnum = 12345
 
function canopen()
try
server = listen(portnum)
println("This is the only instance.")
sleep(20)
catch y
if findfirst("EADDRINUSE", string(y)) != nothing
println("There is already an instance running.")
end
end
end
 
canopen()
</lang>
 
 
=={{header|Kotlin}}==
4,105

edits