mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 17:37:58 -04:00
netty client: log closed address
This commit is contained in:
parent
b028e8f913
commit
5af4c70ae5
@ -50,6 +50,7 @@ import javax.crypto.Cipher
|
|||||||
class NettyClient(
|
class NettyClient(
|
||||||
val connection: Connection,
|
val connection: Connection,
|
||||||
) : SimpleChannelInboundHandler<Any>(), ClientNetwork {
|
) : SimpleChannelInboundHandler<Any>(), ClientNetwork {
|
||||||
|
private var address: ServerAddress? = null
|
||||||
override var connected by observed(false)
|
override var connected by observed(false)
|
||||||
private set
|
private set
|
||||||
override var state by observed(ProtocolStates.HANDSHAKE)
|
override var state by observed(ProtocolStates.HANDSHAKE)
|
||||||
@ -92,6 +93,7 @@ class NettyClient(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun connect(address: ServerAddress, native: Boolean) {
|
override fun connect(address: ServerAddress, native: Boolean) {
|
||||||
|
this.address = address
|
||||||
state = ProtocolStates.HANDSHAKE
|
state = ProtocolStates.HANDSHAKE
|
||||||
val natives = if (native) TransportNatives.get() else NioNatives
|
val natives = if (native) TransportNatives.get() else NioNatives
|
||||||
val bootstrap = Bootstrap()
|
val bootstrap = Bootstrap()
|
||||||
@ -162,7 +164,7 @@ class NettyClient(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun channelInactive(context: ChannelHandlerContext) {
|
override fun channelInactive(context: ChannelHandlerContext) {
|
||||||
Log.log(LogMessageType.NETWORK, LogLevels.VERBOSE) { "Connection closed" }
|
Log.log(LogMessageType.NETWORK, LogLevels.VERBOSE) { "Connection closed ($address)" }
|
||||||
connected = false
|
connected = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user