Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
froks committed Feb 7, 2022
1 parent 69439c4 commit 0494d98
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/kotlin/library/DoipEntity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -193,7 +193,7 @@ open class DoipEntity(
socket.close()
}
} finally {
connectionHandlers.remove(tcpMessageReceiver)
connectionHandlers.remove(tcpMessageHandler)
}
}
}
Expand Down

0 comments on commit 0494d98

Please sign in to comment.