Break out connection handling into a service

This commit is contained in:
Jakob Borg
2015-04-25 19:31:10 +09:00
parent bb31b1785b
commit 266a5116a1
2 changed files with 92 additions and 30 deletions

View File

@@ -574,7 +574,9 @@ func syncthingMain() {
// Routine to connect out to configured devices
discoverer = discovery(externalPort)
go listenConnect(myID, m, tlsCfg)
connectionSvc := newConnectionSvc(cfg, myID, m, tlsCfg)
mainSvc.Add(connectionSvc)
for _, folder := range cfg.Folders() {
// Routine to pull blocks from other devices to synchronize the local