Configurable local announcement port (fixes #256)

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

No files matched your search

+2 -6
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
}