async-io
async-io copied to clipboard
Errno::EINVAL: Invalid argument, Async IO 1.29.0, Windows 10
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
}