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

Setting config.http.nio = true does nothing #136

Open
hydrogen18 opened this issue Jul 11, 2017 · 0 comments
Open

Setting config.http.nio = true does nothing #136

hydrogen18 opened this issue Jul 11, 2017 · 0 comments

Comments

@hydrogen18
Copy link

hydrogen18 commented Jul 11, 2017

I'm using JRuby 9.1.9.0
When you add to trinidad.rb something like this

config.http = { nio: true }

The expectation is an NIO protocol handler is used. It is not.

In lib/trinidad/server.rb the method add_service_connector is defined and contains the following

if handler = options.delete(:protocol_handler) || options.delete(:protocol_handler_class_name)
  connector.protocol_handler_class_name = handler
end

Calling connector.protocol_handler_class_name = handler invokes a method on a Java class, so JRuby is emitting some magic interface here. What it invokes I don't know, but it doesn't do anything useful. I'm unsure if the underlying Java server even allows changing the protocol handler after it is created on the first line of this method

connector = Tomcat::Connector.new(options.delete(:protocol) || protocol)

Specifying the following in my trindad.rb works for me :

config.http = { protocol: "org.apache.coyote.http11.Http11NioProtocol" }

I think all the code around :nio option could just be removed for clarity and cleanliness of the project.

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

1 participant