Skip to content

Commit ba67419

Browse files
committed
Fix old ktor tcp transport implementation
1 parent c5eceb9 commit ba67419

File tree

1 file changed

+5
-3
lines changed
  • rsocket-transports/ktor-tcp/src/commonMain/kotlin/io/rsocket/kotlin/transport/ktor/tcp

1 file changed

+5
-3
lines changed

rsocket-transports/ktor-tcp/src/commonMain/kotlin/io/rsocket/kotlin/transport/ktor/tcp/TcpConnection.kt

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2024 the original author or authors.
2+
* Copyright 2015-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,6 +51,8 @@ internal class TcpConnection(
5151
}
5252
}
5353
}
54+
}.invokeOnCompletion {
55+
sendChannel.cancelWithCause(it)
5456
}
5557
launch {
5658
socketConnection.input.apply {
@@ -65,10 +67,10 @@ internal class TcpConnection(
6567
}
6668
}
6769
}
70+
}.invokeOnCompletion {
71+
receiveChannel.cancelWithCause(it)
6872
}
6973
coroutineContext.job.invokeOnCompletion {
70-
sendChannel.cancelWithCause(it)
71-
receiveChannel.cancelWithCause(it)
7274
socketConnection.input.cancel(it)
7375
socketConnection.output.close(it)
7476
socketConnection.socket.close()

0 commit comments

Comments
 (0)