Add receiver side reconnect
This commit is contained in:
parent
a932d9a35f
commit
f7071fa59e
1 changed files with 14 additions and 1 deletions
|
@ -106,7 +106,7 @@ func (p *Peer) Handle(ctx context.Context) error {
|
||||||
|
|
||||||
lastReconnect := time.Now()
|
lastReconnect := time.Now()
|
||||||
lastHeardFrom := time.Now()
|
lastHeardFrom := time.Now()
|
||||||
lastSend := time.Now()
|
lastSend := time.Now() // TODO: clarify use of lastSend / sendRetries
|
||||||
lastUpdate := time.Now()
|
lastUpdate := time.Now()
|
||||||
sendRetries := 0
|
sendRetries := 0
|
||||||
|
|
||||||
|
@ -434,6 +434,19 @@ func (p *Peer) Handle(ctx context.Context) error {
|
||||||
|
|
||||||
// TODO: Continue sending next RI-Rsp (streamed)?
|
// TODO: Continue sending next RI-Rsp (streamed)?
|
||||||
|
|
||||||
|
if rstate == rsUnconnected {
|
||||||
|
// Receiver is unconnected, but their receiver sent us an
|
||||||
|
// RI-Ack for something
|
||||||
|
// Try to reconnect?
|
||||||
|
lastSend = time.Now()
|
||||||
|
sendRetries = 0
|
||||||
|
if _, err := p.Send(p.Transport.NewOpenReqPacket(nil)); err != nil {
|
||||||
|
log.Printf("AURP Peer: Couldn't send Open-Req packet: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
rstate = rsWaitForOpenRsp
|
||||||
|
}
|
||||||
|
|
||||||
case *aurp.RIUpdPacket:
|
case *aurp.RIUpdPacket:
|
||||||
// TODO: Integrate info into route table
|
// TODO: Integrate info into route table
|
||||||
for _, et := range pkt.Events {
|
for _, et := range pkt.Events {
|
||||||
|
|
Loading…
Reference in a new issue