mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix(tcp): stop emitting redundant permanent disconnect from close()
TcpRadioTransport.close() unconditionally emitted onDisconnect with isPermanent=true. The 'closing' guard at the listener level already suppresses the transient signal during teardown, and the explicit- disconnect emit is owned by SharedRadioInterfaceService.stopTransportLocked. The double-emit caused two terminal disconnect events for one user action and prevented the auto-reconnect loop from cleanly owning its lifecycle.
This commit is contained in:
parent
2137ef3410
commit
0e47dc6717
1 changed files with 5 additions and 1 deletions
|
|
@ -78,7 +78,11 @@ open class TcpRadioTransport(
|
|||
Logger.d { "[$address] Closing TCP transport" }
|
||||
closing = true
|
||||
transport.stop()
|
||||
callback.onDisconnect(isPermanent = true)
|
||||
// Do NOT emit onDisconnect(isPermanent = true) here. The explicit-disconnect signal is the
|
||||
// service layer's responsibility (SharedRadioInterfaceService.stopTransportLocked); emitting
|
||||
// it from close() caused a double-disconnect and prevented the auto-reconnect loop from
|
||||
// owning its own lifecycle. The `closing` guard above suppresses the listener's transient
|
||||
// disconnect during teardown.
|
||||
}
|
||||
|
||||
override fun keepAlive() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue