Skip to content

Commit

Permalink
session closed method
Browse files Browse the repository at this point in the history
  • Loading branch information
lizs committed Aug 11, 2018
1 parent e53041b commit e0e2a05
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ func (s *Session) Close(force bool) {
s.node.internalHandler.OnClose(s, force)
}

// IsClosed 是否关闭
func (s *Session) Closed() bool {
return s == nil || s.closed
}

func (s *Session) elapsedSinceLastResponse() int {
return int(time.Now().Unix() - s.responseTime)
}
Expand Down

0 comments on commit e0e2a05

Please sign in to comment.