Skip to content

Commit

Permalink
close sending channel
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Jul 20, 2024
1 parent 17d9961 commit 9101c28
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.ktor.network.sockets.InetSocketAddress
import io.ktor.network.sockets.Socket
import io.ktor.network.sockets.openWriteChannel
import io.ktor.network.sockets.tcpNoDelay
import io.ktor.utils.io.close
import io.ktor.utils.io.writeFully

internal class ConnectionClient(
Expand Down Expand Up @@ -35,6 +36,8 @@ internal class ConnectionClient(
}.also {
val channel = it.openWriteChannel(autoFlush = true)
channel.writeFully(byteArray, 0, byteArray.size)
channel.flush()
channel.close()
}
}

Expand Down

0 comments on commit 9101c28

Please sign in to comment.