Split Peer and Server Connection Launching
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
21c41f24ee
commit
80c6bcead7
|
@ -93,6 +93,7 @@ type CwtchPeer interface {
|
|||
|
||||
Listen()
|
||||
StartPeersConnections()
|
||||
StartServerConnections()
|
||||
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}))
|
||||
}
|
||||
|
||||
// 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() {
|
||||
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() {
|
||||
if cp.GetContact(contact).IsServer() {
|
||||
cp.JoinServer(contact)
|
||||
} else {
|
||||
cp.PeerWithOnion(contact)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue