mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 15:00:38 +08:00
Explicit implement CoroutineScope
This commit is contained in:
parent
35dd858ffd
commit
41a5ce885d
@ -39,7 +39,7 @@ internal expect val NetworkDispatcher: CoroutineDispatcher
|
|||||||
* @see BotNetworkHandler
|
* @see BotNetworkHandler
|
||||||
*/
|
*/
|
||||||
internal class TIMBotNetworkHandler internal constructor(coroutineContext: CoroutineContext, override inline val bot: Bot) :
|
internal class TIMBotNetworkHandler internal constructor(coroutineContext: CoroutineContext, override inline val bot: Bot) :
|
||||||
BotNetworkHandler<TIMBotNetworkHandler.BotSocketAdapter>, PacketHandlerList() {
|
BotNetworkHandler<TIMBotNetworkHandler.BotSocketAdapter>, PacketHandlerList(), CoroutineScope {
|
||||||
|
|
||||||
|
|
||||||
override val coroutineContext: CoroutineContext =
|
override val coroutineContext: CoroutineContext =
|
||||||
@ -512,7 +512,7 @@ internal class TIMBotNetworkHandler internal constructor(coroutineContext: Corou
|
|||||||
sessionKey = packet.sessionKey
|
sessionKey = packet.sessionKey
|
||||||
bot.logger.info("sessionKey = ${sessionKey.value.toUHexString()}")
|
bot.logger.info("sessionKey = ${sessionKey.value.toUHexString()}")
|
||||||
|
|
||||||
heartbeatJob = launch {
|
heartbeatJob = this@TIMBotNetworkHandler.launch {
|
||||||
while (socket.isOpen) {
|
while (socket.isOpen) {
|
||||||
delay(configuration.heartbeatPeriod.millisecondsLong)
|
delay(configuration.heartbeatPeriod.millisecondsLong)
|
||||||
with(session) {
|
with(session) {
|
||||||
|
Loading…
Reference in New Issue
Block a user