Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Errno::EINVAL: Invalid argument, Async IO 1.29.0, Windows 10 #39

Open
bryanp opened this issue May 5, 2020 · 0 comments
Open

Errno::EINVAL: Invalid argument, Async IO 1.29.0, Windows 10 #39

bryanp opened this issue May 5, 2020 · 0 comments

Comments

@bryanp
Copy link

bryanp commented May 5, 2020

Getting this error when trying to run an Async::HTTP::Server on Windows (async-io v1.29.0):

0.24s    error: Async::Task [oid=0x29ec990] [pid=3392] [2020-05-04 18:22:32 -0700]
               |   Errno::EINVAL: Invalid argument
               |   → C:/Ruby26-x64/lib/ruby/2.6.0/socket.rb 593
               |     C:/Ruby26-x64/lib/ruby/2.6.0/socket.rb 593
               |     C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/async-io-1.29.0/lib/async/io/generic.rb 216
               |     C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/async-io-1.29.0/lib/async/io/socket.rb 62
               |     C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/async-io-1.29.0/lib/async/io/server.rb 36
               |     C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/async-io-1.29.0/lib/async/io/shared_endpoint.rb 104
               |     C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/async-io-1.29.0/lib/async/io/shared_endpoint.rb 76
               |     C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/async-1.25.2/lib/async/task.rb 258

Reporting here because it appears to be an issue in async-io.

Here's how to reproduce:

require "async/reactor"
require "async/io/shared_endpoint"
require "async/http/endpoint"
require "async/http/server"

Async.logger.debug!

endpoint = Async::HTTP::Endpoint.parse("http://localhost:4242")

module Server
  def self.call(*args)
    Async::HTTP::Protocol::Response[200, Protocol::HTTP::Headers.new, "hello from #{Process.pid}"]
  end
end

shared_endpoint = Async::Reactor.run { Async::IO::SharedEndpoint.bound(endpoint) }.wait

Async::Reactor.run {
  Async::HTTP::Server.new(Server, shared_endpoint, endpoint.protocol, endpoint.scheme).run
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant