mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-19 12:25:12 -04:00
netty: ignore disconnect state when sending packets
This commit is contained in:
parent
eb1caf4e2a
commit
44d073e7ad
@ -150,7 +150,7 @@ class NettyClient(
|
||||
}
|
||||
|
||||
fun send(packet: C2SPacket) {
|
||||
val channel = requireChannel()
|
||||
val channel = getChannel() ?: return
|
||||
if (sendingPaused) {
|
||||
packetQueue += packet
|
||||
return
|
||||
@ -205,6 +205,14 @@ class NettyClient(
|
||||
return channel
|
||||
}
|
||||
|
||||
private fun getChannel(): Channel? {
|
||||
val channel = this.channel
|
||||
if (!connected || channel == null) {
|
||||
return null
|
||||
}
|
||||
return channel
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val NIO_THREAD_POOL by lazy { NioEventLoopGroup(NamedThreadFactory("Nio#%d")) }
|
||||
private val EPOLL_THREAD_POOL by lazy { EpollEventLoopGroup(NamedThreadFactory("Epoll#%d")) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user