mirror of
https://github.com/ehang-io/nps.git
synced 2026-10-31 16:52:12 +08:00
add android auto reconnect
This commit is contained in:
1 parent
d251431baa
commit
cb8464f4a8
1 file changed
+8
-2
+8
-2
@@ -107,8 +107,14 @@ func onclick(s, v, c string) {
|
||||
if sp != s || vk != v || ct != c {
|
||||
saveConfig(s, v, c)
|
||||
}
|
||||
cl = client.NewRPClient(s, v, c, "", nil, 60)
|
||||
go cl.Start()
|
||||
go func() {
|
||||
for {
|
||||
cl = client.NewRPClient(s, v, c, "", nil, 60)
|
||||
cl.Start()
|
||||
logs.Info("client disconnected, reconnecting in 5 seconds...")
|
||||
time.Sleep(time.Second * 5)
|
||||
}
|
||||
}()
|
||||
} else {
|
||||
// close the npc
|
||||
status = "Start!"
|
||||
|
||||
Reference in new issue
Block a user