With Windows 10 right around the corner, it would be great if Syncthing would follow the new API released with Windows 8.
Basically, when a user is on a metered connection, Syncthing would pause all syncs. This would help forgetful people like me to stay within our mobile broadband limit.
Here is some information that might make this easier.
I would be happy to test.
You can write something externally which stops syncthing.
Syncthing tries to be cross platform, hence implementing Windows APIs is not really that cross-platform.
If I had the know how, I would definitely do that.
I was able to get Syncthing running as a Windows service. Does anyone know of a program that can stop a service when on a metered connection?
I am pretty sure that Windows Services were intended to be running at all times.
Alternatively, you could set up the Windows Task Scheduler to start and stop syncthing.exe. Task Scheduler has a lot of scheduling options - hopefully you can align this with your connection constraints.
I’d be happy to include this sort of behaviour into SyncTrayzor, but don’t have a Window 8 machine to test on. If you’re interested, we could start a process of my writing in some functionality, then giving you a build to test…
PS, be very careful when running Syncthing as a windows service. If you’re running it as any user other than yourself, make sure you have set a GUI password, otherwise you’re opening a security hole, as explained here
Note that if this is essentially some API that returns a boolean saying “yeah, internet is kinda expensive right now”, then we could build support for it. We do have some parts that are Windows specific anyway, adding one more won’t kill us. Especially as/if it doesn’t bother any other platform.
Well looking up memory is possible on all systems, hence why we implement it.
I am not sure if all OS’es have the concept of metered connections though.
True. The cleaner way is probably for something native, such as Synctrayzor, to do the detection and stop syncthing as appropriate.
I can help test builds, I am running Windows 8.1 Pro. I can set WiFi connection as metered. I even have 3G modem in my laptop, but I will be selling it soon.
I had a look into this. I looks like this API is only available to C# Windows 8 Store applications - there’s no way I could make use of it.
It may be possible for Syncthing / SyncTrayzor to offer something similar: give the user a list of network interfaces and allow them to select which ones they want Syncthing to be active on. Not sure how confusing that would be…