Skip to content

Commit

Permalink
Partially revert "Merge pull request typelevel#2644 from stephennance…
Browse files Browse the repository at this point in the history
…kivell/fix/typelevelGH-2643-socket-leak"

This partially reverts commit 271f8b8, reversing
changes made to f92941b.
  • Loading branch information
armanbilge committed Oct 5, 2021
1 parent b2a90a1 commit fc3872a
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 fc3872a

Please sign in to comment.