Class: Baykit::BayServer::Agent::NonBlockingHandler::ChannelState

Inherits:
Object
  • Object
show all
Defined in:
lib/baykit/bayserver/agent/non_blocking_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ch, lis) ⇒ ChannelState

Returns a new instance of ChannelState.



26
27
28
29
30
31
32
# File 'lib/baykit/bayserver/agent/non_blocking_handler.rb', line 26

def initialize(ch, lis)
  @channel = ch
  @listener = lis
  @accepted = false
  @connecting = false
  @closing = false
end

Instance Attribute Details

#acceptedObject

Returns the value of attribute accepted.



18
19
20
# File 'lib/baykit/bayserver/agent/non_blocking_handler.rb', line 18

def accepted
  @accepted
end

#channelObject (readonly)

Returns the value of attribute channel.



19
20
21
# File 'lib/baykit/bayserver/agent/non_blocking_handler.rb', line 19

def channel
  @channel
end

#closingObject

Returns the value of attribute closing.



22
23
24
# File 'lib/baykit/bayserver/agent/non_blocking_handler.rb', line 22

def closing
  @closing
end

#connectingObject

Returns the value of attribute connecting.



21
22
23
# File 'lib/baykit/bayserver/agent/non_blocking_handler.rb', line 21

def connecting
  @connecting
end

#last_access_timeObject (readonly)

Returns the value of attribute last_access_time.



24
25
26
# File 'lib/baykit/bayserver/agent/non_blocking_handler.rb', line 24

def last_access_time
  @last_access_time
end

#listenerObject (readonly)

Returns the value of attribute listener.



20
21
22
# File 'lib/baykit/bayserver/agent/non_blocking_handler.rb', line 20

def listener
  @listener
end

Instance Method Details

#accessObject



34
35
36
# File 'lib/baykit/bayserver/agent/non_blocking_handler.rb', line 34

def access
  @last_access_time = DateTime.now
end

#to_sObject



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/baykit/bayserver/agent/non_blocking_handler.rb', line 38

def to_s
 if @listener != nil
    str = @listener.to_s
  else
    str = super.to_s
 end
 if @closing
   str += " closing";
 end
 return str
end