Configurable local announcement port (fixes #256)

This commit is contained in:
Jakob Borg
2014-05-22 09:35:54 +02:00
parent 2e1c33206f
commit ae0193b724
4 changed files with 7 additions and 7 deletions

View File

@@ -13,10 +13,6 @@ import (
"github.com/calmh/syncthing/buffers"
)
const (
AnnouncementPort = 21025
)
type Discoverer struct {
myID string
listenAddrs []string
@@ -42,8 +38,8 @@ var (
// When we hit this many errors in succession, we stop.
const maxErrors = 30
func NewDiscoverer(id string, addresses []string) (*Discoverer, error) {
b, err := beacon.New(21025)
func NewDiscoverer(id string, addresses []string, localPort int) (*Discoverer, error) {
b, err := beacon.New(localPort)
if err != nil {
return nil, err
}