mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-07 08:30:11 +08:00
Improve network availability check
This commit is contained in:
parent
5cd027dfa9
commit
a1322076fc
@ -150,7 +150,7 @@ internal object HighwayHelper {
|
||||
// require(commandId == 2 || commandId == 1) { "bad commandId. Must be 1 or 2" }
|
||||
|
||||
val socket = PlatformSocket()
|
||||
while (client.bot.network.isActive) {
|
||||
while (client.bot.network.areYouOk() && client.bot.isActive) {
|
||||
try {
|
||||
socket.connect(EmptyCoroutineContext, serverIp, serverPort)
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user