Skip to content

Commit 4d6c1e1

Browse files
authored
Merge pull request #3238 from armanbilge/topic/jvm-socket-readwrite-cancel-suppress-errors
Suppress errors in socket read/write canceler
2 parents 9b75ab4 + 4994388 commit 4d6c1e1

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

io/jvm-native/src/main/scala/fs2/io/net/SocketPlatform.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ private[net] trait SocketCompanionPlatform {
117117
null,
118118
new IntCompletionHandler(cb)
119119
)
120-
F.delay(Some(F.delay {
121-
ch.shutdownInput()
122-
()
123-
}))
120+
F.delay(Some(endOfInput.voidError))
124121
}
125122

126123
def write(bytes: Chunk[Byte]): F[Unit] = {
@@ -131,10 +128,7 @@ private[net] trait SocketCompanionPlatform {
131128
null,
132129
new IntCompletionHandler(cb)
133130
)
134-
F.delay(Some(F.delay {
135-
ch.shutdownOutput()
136-
()
137-
}))
131+
F.delay(Some(endOfOutput.voidError))
138132
}.flatMap { written =>
139133
if (written >= 0 && buff.remaining() > 0)
140134
go(buff)

io/jvm/src/test/scala/fs2/io/IoPlatformSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import java.util.concurrent.Executors
3939
class IoPlatformSuite extends Fs2Suite {
4040

4141
// This suite runs for a long time, this avoids timeouts in CI.
42-
override def munitIOTimeout: Duration = 1.minute
42+
override def munitIOTimeout: Duration = 2.minutes
4343

4444
group("readOutputStream") {
4545
test("writes data and terminates when `f` returns") {

0 commit comments

Comments
 (0)