Class: TUB::UpgradableTcpServer
- Inherits:
-
Thin::Backends::TcpServer
- Object
- Thin::Backends::TcpServer
- TUB::UpgradableTcpServer
- Defined in:
- lib/tub/upgradable_tcp_server.rb
Instance Attribute Summary collapse
-
#ssl ⇒ Object
Returns the value of attribute ssl.
Instance Method Summary collapse
-
#connect ⇒ Object
Connect the server.
-
#initialize(host, port, options) ⇒ UpgradableTcpServer
constructor
Thin::Server assumes we’ll have options.
Constructor Details
#initialize(host, port, options) ⇒ UpgradableTcpServer
Thin::Server assumes we’ll have options
47 48 49 50 51 52 |
# File 'lib/tub/upgradable_tcp_server.rb', line 47 def initialize(host, port, ) super(host, port) UpgradableConnection.initial_handler_class = Thin::Connection raise ":handler_on_upgrade must be provided" unless [:handler_on_upgrade] UpgradableConnection.upgraded_handler_class = [:handler_on_upgrade] end |
Instance Attribute Details
#ssl ⇒ Object
Returns the value of attribute ssl.
45 46 47 |
# File 'lib/tub/upgradable_tcp_server.rb', line 45 def ssl @ssl end |
Instance Method Details
#connect ⇒ Object
Connect the server
55 56 57 |
# File 'lib/tub/upgradable_tcp_server.rb', line 55 def connect @signature = EventMachine.start_server(@host, @port, UpgradableConnection, &method(:initialize_connection)) end |