Module: Rubarb::Listener
- Includes:
- ConnectionId
- Defined in:
- lib/rubarb/server.rb
Constant Summary collapse
- INCOMING_CONNECTION =
- OUTGOING_CONNECTION =
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#callback ⇒ Object
Returns the value of attribute callback.
-
#conn_id ⇒ Object
readonly
Returns the value of attribute conn_id.
-
#conn_id_generator ⇒ Object
Returns the value of attribute conn_id_generator.
-
#errbacks ⇒ Object
Returns the value of attribute errbacks.
-
#external_protocol ⇒ Object
Returns the value of attribute external_protocol.
-
#insecure_methods ⇒ Object
Returns the value of attribute insecure_methods.
-
#keep_alive_time ⇒ Object
Returns the value of attribute keep_alive_time.
-
#msg_id_generator ⇒ Object
Returns the value of attribute msg_id_generator.
-
#new_connection_callback ⇒ Object
Returns the value of attribute new_connection_callback.
-
#unbindback ⇒ Object
Returns the value of attribute unbindback.
Instance Method Summary collapse
- #call_errbacks(message) ⇒ Object
- #cancel_keep_alive ⇒ Object
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Methods included from ConnectionId
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
133 134 135 |
# File 'lib/rubarb/server.rb', line 133 def api @api end |
#callback ⇒ Object
Returns the value of attribute callback.
135 136 137 |
# File 'lib/rubarb/server.rb', line 135 def callback @callback end |
#conn_id ⇒ Object (readonly)
Returns the value of attribute conn_id.
131 132 133 |
# File 'lib/rubarb/server.rb', line 131 def conn_id @conn_id end |
#conn_id_generator ⇒ Object
Returns the value of attribute conn_id_generator.
130 131 132 |
# File 'lib/rubarb/server.rb', line 130 def conn_id_generator @conn_id_generator end |
#errbacks ⇒ Object
Returns the value of attribute errbacks.
136 137 138 |
# File 'lib/rubarb/server.rb', line 136 def errbacks @errbacks end |
#external_protocol ⇒ Object
Returns the value of attribute external_protocol.
139 140 141 |
# File 'lib/rubarb/server.rb', line 139 def external_protocol @external_protocol end |
#insecure_methods ⇒ Object
Returns the value of attribute insecure_methods.
138 139 140 |
# File 'lib/rubarb/server.rb', line 138 def insecure_methods @insecure_methods end |
#keep_alive_time ⇒ Object
Returns the value of attribute keep_alive_time.
140 141 142 |
# File 'lib/rubarb/server.rb', line 140 def keep_alive_time @keep_alive_time end |
#msg_id_generator ⇒ Object
Returns the value of attribute msg_id_generator.
132 133 134 |
# File 'lib/rubarb/server.rb', line 132 def msg_id_generator @msg_id_generator end |
#new_connection_callback ⇒ Object
Returns the value of attribute new_connection_callback.
134 135 136 |
# File 'lib/rubarb/server.rb', line 134 def new_connection_callback @new_connection_callback end |
#unbindback ⇒ Object
Returns the value of attribute unbindback.
137 138 139 |
# File 'lib/rubarb/server.rb', line 137 def unbindback @unbindback end |
Instance Method Details
#call_errbacks(message) ⇒ Object
163 164 165 166 167 |
# File 'lib/rubarb/server.rb', line 163 def call_errbacks() @errbacks.each do |e| e.call() end end |
#cancel_keep_alive ⇒ Object
153 154 155 |
# File 'lib/rubarb/server.rb', line 153 def cancel_keep_alive #will be replaced by later included modules end |
#post_init ⇒ Object
144 145 146 |
# File 'lib/rubarb/server.rb', line 144 def post_init @buffer = "" end |
#receive_data(data) ⇒ Object
148 149 150 151 |
# File 'lib/rubarb/server.rb', line 148 def receive_data data @buffer << data handshake(@buffer) if @conn_id.nil? end |
#unbind ⇒ Object
157 158 159 160 161 |
# File 'lib/rubarb/server.rb', line 157 def unbind cancel_keep_alive call_errbacks(ConnectionError.new) @unbindback.call(self) if @unbindback end |