Skip to content

Commit d76bdea

Browse files
committed
Properly suspend toByteBuffer
1 parent 02be9c3 commit d76bdea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private[net] trait SocketCompanionPlatform {
141141
else F.unit
142142
}
143143
writeMutex.lock.surround {
144-
go(bytes.toByteBuffer)
144+
F.delay(bytes.toByteBuffer).flatMap(go)
145145
}
146146
}
147147

io/jvm/src/main/scala/fs2/io/net/unixsocket/UnixSocketsPlatform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private[unixsocket] trait UnixSocketsCompanionPlatform {
111111
else go(buff)
112112
}
113113
writeMutex.lock.surround {
114-
go(bytes.toByteBuffer)
114+
F.delay(bytes.toByteBuffer).flatMap(go)
115115
}
116116
}
117117

0 commit comments

Comments
 (0)