MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / IsDone

Method IsDone

internal/session/session.go:241–252  ·  view source on GitHub ↗

IsDone reports whether both FIN frames (sent and received) have flowed, OR whether we sent our FIN but the peer's FIN never arrived within sessionFinalTimeout. The timeout prevents orphaned sessions from accumulating in the carrier's session map when a relay response carrying the peer's FIN is dropp

()

Source from the content-addressed store, hash-verified

239// in the carrier's session map when a relay response carrying the peer's FIN
240// is dropped.
241func (s *Session) IsDone() bool {
242 s.mu.Lock()
243 defer s.mu.Unlock()
244 if s.finSent && s.rxClosed {
245 return true
246 }
247 // Reap orphaned sessions: we sent our FIN but never received the peer's.
248 if s.finSent && !s.finSentAt.IsZero() && time.Since(s.finSentAt) > sessionFinalTimeout {
249 return true
250 }
251 return false
252}
253
254// DrainSnapshot captures the pre-drain state of a session so the caller can
255// roll back via RollbackDrain if the batch carrying the drained frames cannot

Callers 2

gcDoneSessionsMethod · 0.80
gcDoneSessionsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected