From 0494d98cee7246782ad196883a688ea9828c013d Mon Sep 17 00:00:00 2001 From: Florian Roks Date: Mon, 7 Feb 2022 22:17:53 +0100 Subject: [PATCH] rename variable --- src/main/kotlin/library/DoipEntity.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/library/DoipEntity.kt b/src/main/kotlin/library/DoipEntity.kt index 88d0bb8..3a4a0dd 100644 --- a/src/main/kotlin/library/DoipEntity.kt +++ b/src/main/kotlin/library/DoipEntity.kt @@ -152,15 +152,15 @@ open class DoipEntity( protected open fun CoroutineScope.handleTcpSocket(socket: Socket) { launch { logger.debugIf { "New incoming TCP connection from ${socket.remoteAddress}" } - val tcpMessageReceiver = createDoipTcpMessageHandler(socket) + val tcpMessageHandler = createDoipTcpMessageHandler(socket) val input = socket.openReadChannel() - val output = socket.openWriteChannel(autoFlush = tcpMessageReceiver.isAutoFlushEnabled()) + val output = socket.openWriteChannel(autoFlush = tcpMessageHandler.isAutoFlushEnabled()) try { - connectionHandlers.add(tcpMessageReceiver) + connectionHandlers.add(tcpMessageHandler) while (!socket.isClosed) { try { - val message = tcpMessageReceiver.receiveTcpData(input) - tcpMessageReceiver.handleTcpMessage(message, output) + val message = tcpMessageHandler.receiveTcpData(input) + tcpMessageHandler.handleTcpMessage(message, output) } catch (e: ClosedReceiveChannelException) { // ignore - socket was closed logger.debug("Socket was closed by remote ${socket.remoteAddress}") @@ -193,7 +193,7 @@ open class DoipEntity( socket.close() } } finally { - connectionHandlers.remove(tcpMessageReceiver) + connectionHandlers.remove(tcpMessageHandler) } } }