Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TLSSocket addresses on JS #3256

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

armanbilge
Copy link
Member

Comment on lines +383 to +401
Stream
.resource(setup)
.flatMap { case (server, clientSocket) =>
val serverSocketAddresses = server.evalMap { socket =>
socket.localAddress.product(socket.remoteAddress)
}

val clientSocketAddresses =
Stream.resource(clientSocket).evalMap { socket =>
socket.localAddress.product(socket.remoteAddress)
}

serverSocketAddresses.parZip(clientSocketAddresses).map {
case ((serverLocal, serverRemote), (clientLocal, clientRemote)) =>
assertEquals(clientRemote, serverLocal)
assertEquals(clientLocal, serverRemote)
}
}
.compile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this test can be written in Resource, down from Stream?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serverSocketAddresses is a Stream because server is a Stream of sockets. So we need a .compile somewhere, although it could be sooner rather than later.

@armanbilge armanbilge merged commit 9c52344 into typelevel:main Jul 11, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants