mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
Rename mc -> beacon
This commit is contained in:
parent
3e34fc66e6
commit
adbd0b1834
@ -1,4 +1,4 @@
|
|||||||
package mc
|
package beacon
|
||||||
|
|
||||||
import "net"
|
import "net"
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ type Beacon struct {
|
|||||||
outbox chan recv
|
outbox chan recv
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBeacon(port int) (*Beacon, error) {
|
func New(port int) (*Beacon, error) {
|
||||||
conn, err := net.ListenUDP("udp", &net.UDPAddr{Port: port})
|
conn, err := net.ListenUDP("udp", &net.UDPAddr{Port: port})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
@ -1,4 +1,4 @@
|
|||||||
package mc
|
package beacon
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
@ -8,6 +8,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
debug = strings.Contains(os.Getenv("STTRACE"), "mc") || os.Getenv("STTRACE") == "all"
|
debug = strings.Contains(os.Getenv("STTRACE"), "beacon") || os.Getenv("STTRACE") == "all"
|
||||||
l = logger.DefaultLogger
|
l = logger.DefaultLogger
|
||||||
)
|
)
|
@ -9,8 +9,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/calmh/syncthing/beacon"
|
||||||
"github.com/calmh/syncthing/buffers"
|
"github.com/calmh/syncthing/buffers"
|
||||||
"github.com/calmh/syncthing/mc"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -22,7 +22,7 @@ type Discoverer struct {
|
|||||||
listenAddrs []string
|
listenAddrs []string
|
||||||
localBcastIntv time.Duration
|
localBcastIntv time.Duration
|
||||||
globalBcastIntv time.Duration
|
globalBcastIntv time.Duration
|
||||||
beacon *mc.Beacon
|
beacon *beacon.Beacon
|
||||||
registry map[string][]string
|
registry map[string][]string
|
||||||
registryLock sync.RWMutex
|
registryLock sync.RWMutex
|
||||||
extServer string
|
extServer string
|
||||||
@ -43,7 +43,7 @@ var (
|
|||||||
const maxErrors = 30
|
const maxErrors = 30
|
||||||
|
|
||||||
func NewDiscoverer(id string, addresses []string) (*Discoverer, error) {
|
func NewDiscoverer(id string, addresses []string) (*Discoverer, error) {
|
||||||
b, err := mc.NewBeacon(21025)
|
b, err := beacon.New(21025)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user