Determine if only one instance is running: Difference between revisions
Determine if only one instance is running (view source)
Revision as of 07:00, 15 October 2018
, 5 years ago→{{header|Kotlin}}
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}}==
|