Skip to content

Commit

Permalink
Merge pull request #2665 from armanbilge/fix/socket-close
Browse files Browse the repository at this point in the history
Fix socket close regression
  • Loading branch information
mpilquist authored Oct 6, 2021
2 parents e345809 + fc3872a commit 6149851
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions io/jvm/src/main/scala/fs2/io/net/SocketPlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ private[net] trait SocketCompanionPlatform {
private[net] def forAsync[F[_]: Async](
ch: AsynchronousSocketChannel
): Resource[F, Socket[F]] =
Resource.eval {
Resource.make {
(Semaphore[F](1), Semaphore[F](1)).mapN { (readSemaphore, writeSemaphore) =>
new AsyncSocket[F](ch, readSemaphore, writeSemaphore)
}
}
}(_ => Async[F].delay(if (ch.isOpen) ch.close else ()))

private[net] abstract class BufferedReads[F[_]](
readSemaphore: Semaphore[F]
Expand Down

0 comments on commit 6149851

Please sign in to comment.