reduce waituntilauthenticated delay and add one for psc
This commit is contained in:
parent
6b98b32156
commit
f271638422
|
@ -95,7 +95,7 @@ func (ppc *PeerPeerConnection) WaitTilAuthenticated() {
|
||||||
if ppc.GetState() == AUTHENTICATED {
|
if ppc.GetState() == AUTHENTICATED {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
time.Sleep(time.Second * 5)
|
time.Sleep(time.Second * 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,16 @@ func (psc *PeerServerConnection) GetState() ConnectionState {
|
||||||
return psc.state
|
return psc.state
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WaitTilAuthenticated waits until the underlying connection is authenticated
|
||||||
|
func (psc *PeerServerConnection) WaitTilAuthenticated() {
|
||||||
|
for {
|
||||||
|
if psc.GetState() == AUTHENTICATED {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
time.Sleep(time.Second * 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Run manages the setup and teardown of a peer server connection
|
// Run manages the setup and teardown of a peer server connection
|
||||||
func (psc *PeerServerConnection) Run() error {
|
func (psc *PeerServerConnection) Run() error {
|
||||||
log.Printf("Connecting to %v", psc.Server)
|
log.Printf("Connecting to %v", psc.Server)
|
||||||
|
|
Loading…
Reference in New Issue