Class: Bane::Behaviors::Servers::TimeoutInListenQueue
- Inherits:
-
Object
- Object
- Bane::Behaviors::Servers::TimeoutInListenQueue
- Defined in:
- lib/bane/behaviors/servers/timeout_in_listen_queue.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(port, host = Servers::LOCALHOST) ⇒ TimeoutInListenQueue
constructor
A new instance of TimeoutInListenQueue.
- #join ⇒ Object
- #start ⇒ Object
- #stdlog=(logger) ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(port, host = Servers::LOCALHOST) ⇒ TimeoutInListenQueue
Returns a new instance of TimeoutInListenQueue.
9 10 11 12 13 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 9 def initialize(port, host = Servers::LOCALHOST) @port = port @host = host self.stdlog= $stderr end |
Class Method Details
.make(port, host) ⇒ Object
36 37 38 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 36 def self.make(port, host) new(port, host) end |
Instance Method Details
#join ⇒ Object
23 24 25 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 23 def join sleep end |
#start ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 15 def start @server = Socket.new(:INET, :STREAM) address = Socket.sockaddr_in(port, host) @server.bind(address) # Note that we never call listen log 'started' end |
#stdlog=(logger) ⇒ Object
32 33 34 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 32 def stdlog=(logger) @logger = logger end |
#stop ⇒ Object
27 28 29 30 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 27 def stop @server.close log 'stopped' end |