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.
11 12 13 14 15 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 11 def initialize(port, host = Servers::LOCALHOST) @port = port @host = host self.stdlog= $stderr end |
Class Method Details
.make(port, host) ⇒ Object
38 39 40 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 38 def self.make(port, host) new(port, host) end |
Instance Method Details
#join ⇒ Object
25 26 27 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 25 def join sleep end |
#start ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 17 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
34 35 36 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 34 def stdlog=(logger) @logger = logger end |
#stop ⇒ Object
29 30 31 32 |
# File 'lib/bane/behaviors/servers/timeout_in_listen_queue.rb', line 29 def stop @server.close log 'stopped' end |