Eliminate ConnectionMaker Start method

This commit is contained in:
David Wragg committed 2015-06-24 17:35:26 +01:00
1 parent 8f5d1eec11
commit f444ae9224
2 files changed
+5 -8

No files matched your search

+5 -7
View File
@@ -37,19 +37,17 @@ type Target struct {
type ConnectionMakerAction func() bool
func NewConnectionMaker(ourself *LocalPeer, peers *Peers, port int, discovery bool) *ConnectionMaker {
return &ConnectionMaker{
actionChan := make(chan ConnectionMakerAction, ChannelSize)
cm := &ConnectionMaker{
ourself: ourself,
peers: peers,
port: port,
discovery: discovery,
directPeers: peerAddrs{},
targets: make(map[string]*Target)}
}
func (cm *ConnectionMaker) Start() {
actionChan := make(chan ConnectionMakerAction, ChannelSize)
cm.actionChan = actionChan
targets: make(map[string]*Target),
actionChan: actionChan}
go cm.queryLoop(actionChan)
return cm
}
func (cm *ConnectionMaker) InitiateConnections(peers []string, replace bool) []error {
-1
View File
@@ -95,7 +95,6 @@ func (router *Router) Start() {
po, err = NewPcapO(router.Iface.Name)
checkFatal(err)
}
router.ConnectionMaker.Start()
router.UDPListener = router.listenUDP(router.Port, po)
router.listenTCP(router.Port)
if pio != nil {