Closed iwanbk closed 1 month ago
One of the quick solution is to restart the mycelium after wake up.
I have tried these things:
restart mycelium from within the PacketTunnelProvider, but didn't work. Some observation:
Add sleep and wake up handler to macos NSWindow
restart
is that current restart is triggered from the NSWindow, not within PacketTunnelProvideri found that restarting mycelium outside the PacketTunnelProvider works perfectly.
I use https://pub.dev/packages/flutter_desktop_sleep to detect wake
event and do the restart.
I also found that the problem might be in mycelium
itself because:
"Frame error from TCP 192.168.1.6:55080 <-> 68.183.228.64:9651: Connection reset by peer (os error 54)
on minutes 28:31
Connected to new peer
2024-10-02T07:28:31.439602Z INFO mycelium::peer_manager: Accepted new inbound peer
2024-10-02T07:28:31.439650Z INFO add_peer: mycelium::peer_manager: Added new peer peer.endpoint=Tcp [::ffff:36.80.99.115]:55229
2024-10-02T07:28:31.464380Z INFO mycelium::router: Acquired route subnet=525:c933:ef2e:bfe7::/64 peer="TCP [::ffff:68.183.228.64]:9651 <-> [::ffff:36.80.99.115]:55229"
024-10-02T07:30:38.961313Z INFO mycelium::router: Acquired route subnet=525:c933:ef2e:bfe7::/64 peer="TCP 192.168.0.108:53200 <-> 68.183.228.64:9651"
it only take ~2 minutes versus > 10 minutes on mycelium public node, sometimes almost instantly
fixed at #71
The
ping
become failed when the app put to sleep. (It is expected).app state
ping side
But the
ping
didn't instantly recovered after the app wake up again (not expected) app stateping side
The recovery time varied, sometimes almost instantly but sometimes more than 10 minutes. The long recovery was noticed when the battery is low (< 20%)
One of the quick solution is to restart the mycelium after wake up.