nitroshare / nitroshare-desktop

Network file transfer application for Windows, OS X, & Linux
http://nitroshare.net
MIT License
1.58k stars 224 forks source link

Prevent multiple instances from running #30

Closed nathan-osman closed 6 years ago

nathan-osman commented 9 years ago

It would be nice if NitroShare presented a warning that indicated another instance was running if that was the case. Although subsequent instances will display an error about not being able to bind to the transfer port, the application will still run.

nathan-osman commented 9 years ago

It should be possible to solve this and facilitate authentication with the local API at the same time by creating some sort of token upon startup that only other local applications can access. The presence of the token would suggest that another instance is already running.

nathan-osman commented 8 years ago

The local API should make this trivial. An additional route (something to the effect of /ping) can be used to see if NitroShare is running and if so, refuse to start.

rapgro commented 6 years ago

https://doc.qt.io/archives/qtopia4.3/qtopiadesktop/qtsingleapplication.html https://github.com/qtproject/qt-solutions/tree/master/qtsingleapplication