Skip to content

Commit

Permalink
closer; improved readyToClose (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Aug 27, 2021
1 parent dae294b commit 9aae041
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions closer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,22 @@ func (c *closer) emergencyStop() {
}
}

func (c *closer) timeout() {
logrus.Info("timeout")

c.txp.close()
c.rxp.Close()

if c.closeHook != nil {
c.closeHook()
}
}

func (c *closer) run() {
}

func (c *closer) readyToClose() bool {
return (c.txCloseSeq != notClosed && c.rxCloseSeq != notClosed) || time.Since(c.lastEvent).Milliseconds() > int64(c.txp.alg.Profile().ConnectionTimeout)
}

const notClosed = int32(-99)

0 comments on commit 9aae041

Please sign in to comment.