Merge pull request 'Split Peer and Server Connection Launching' (#326) from gating into master
the build was successful
Details
the build was successful
Details
Reviewed-on: #326
This commit is contained in:
commit
8b176327a7
|
@ -93,6 +93,7 @@ type CwtchPeer interface {
|
||||||
|
|
||||||
Listen()
|
Listen()
|
||||||
StartPeersConnections()
|
StartPeersConnections()
|
||||||
|
StartServerConnections()
|
||||||
Shutdown()
|
Shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,13 +481,20 @@ func (cp *cwtchPeer) Listen() {
|
||||||
cp.eventBus.Publish(event.NewEvent(event.ProtocolEngineStartListen, map[event.Field]string{event.Onion: cp.Profile.Onion}))
|
cp.eventBus.Publish(event.NewEvent(event.ProtocolEngineStartListen, map[event.Field]string{event.Onion: cp.Profile.Onion}))
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartGroupConnections attempts to connect to all group servers (thus initiating reconnect attempts in the conectionsmanager)
|
// StartPeersConnections attempts to connect to peer connections
|
||||||
func (cp *cwtchPeer) StartPeersConnections() {
|
func (cp *cwtchPeer) StartPeersConnections() {
|
||||||
|
for _, contact := range cp.GetContacts() {
|
||||||
|
if cp.GetContact(contact).IsServer() == false {
|
||||||
|
cp.PeerWithOnion(contact)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// StartServerConnections attempts to connect to all server connections
|
||||||
|
func (cp *cwtchPeer) StartServerConnections() {
|
||||||
for _, contact := range cp.GetContacts() {
|
for _, contact := range cp.GetContacts() {
|
||||||
if cp.GetContact(contact).IsServer() {
|
if cp.GetContact(contact).IsServer() {
|
||||||
cp.JoinServer(contact)
|
cp.JoinServer(contact)
|
||||||
} else {
|
|
||||||
cp.PeerWithOnion(contact)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue