mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-23 06:10:30 +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" }
|
// require(commandId == 2 || commandId == 1) { "bad commandId. Must be 1 or 2" }
|
||||||
|
|
||||||
val socket = PlatformSocket()
|
val socket = PlatformSocket()
|
||||||
while (client.bot.network.isActive) {
|
while (client.bot.network.areYouOk() && client.bot.isActive) {
|
||||||
try {
|
try {
|
||||||
socket.connect(EmptyCoroutineContext, serverIp, serverPort)
|
socket.connect(EmptyCoroutineContext, serverIp, serverPort)
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user