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

Client Socket Example not compiling as is #412

Open
aryzach opened this issue Sep 27, 2021 · 1 comment
Open

Client Socket Example not compiling as is #412

aryzach opened this issue Sep 27, 2021 · 1 comment

Comments

@aryzach
Copy link

aryzach commented Sep 27, 2021

The client socket example wasn't compiling.

I was getting an error message saying something like 'open isn't a method of AsynchronousSocketChannel'. The source code for AsynchronousSocketChannel makes it seem like the stated example should be working, but it didn't.

I also needed to import zio.nio.core._

I was able to get it to compile with the following:

val clientM: Managed[Exception, AsynchronousSocketChannel] = {
    AsynchronousSocketChannel()
      .mapM { client =>
        for {
          host    <- InetAddress.localHost
          address <- InetSocketAddress.inetAddress(host, 9418)
          _       <- client.connect(address)
        } yield client
      }
  }
@13h3r
Copy link

13h3r commented Jan 22, 2022

The example by provided link works fine to me

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

No branches or pull requests

2 participants