slskd
slskd copied to clipboard
Add a mutex to prevent multiple instances of slskd from running on the same machine
There's no good-faith use case for running more than one instance of slskd concurrently on the same system. Add a mutex to ensure good-faith usage.
Could you please assign this issue to me? Would love to work on it.
Sure thing!
This Stack Overflow answer should be helpful: https://stackoverflow.com/questions/2186747/how-can-i-create-a-system-mutex-in-c-sharp
For the name I think AppName should work well enough.
Right around this line would be a good place to add the logic. The app should be able to be run in command mode if it's already running, but if it is starting as a daemon we'll want to obtain the mutex/check it.