Module: Rubarb::IncomingHandler
- Includes:
- ConnectionId
- Defined in:
- lib/rubarb/connection.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#id ⇒ Object
Returns the value of attribute id.
-
#insecure_methods ⇒ Object
Returns the value of attribute insecure_methods.
-
#on_connection ⇒ Object
Returns the value of attribute on_connection.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #call_errbacks(message) ⇒ Object
- #connection_completed ⇒ Object
- #post_init ⇒ Object
- #receive_message(message) ⇒ Object
- #unbind ⇒ Object
Methods included from ConnectionId
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
15 16 17 |
# File 'lib/rubarb/connection.rb', line 15 def api @api end |
#id ⇒ Object
Returns the value of attribute id.
13 14 15 |
# File 'lib/rubarb/connection.rb', line 13 def id @id end |
#insecure_methods ⇒ Object
Returns the value of attribute insecure_methods.
16 17 18 |
# File 'lib/rubarb/connection.rb', line 16 def insecure_methods @insecure_methods end |
#on_connection ⇒ Object
Returns the value of attribute on_connection.
14 15 16 |
# File 'lib/rubarb/connection.rb', line 14 def on_connection @on_connection end |
#parent ⇒ Object
Returns the value of attribute parent.
17 18 19 |
# File 'lib/rubarb/connection.rb', line 17 def parent @parent end |
Instance Method Details
#call_errbacks(message) ⇒ Object
43 44 45 |
# File 'lib/rubarb/connection.rb', line 43 def call_errbacks() @parent.call_errbacks() end |
#connection_completed ⇒ Object
23 24 25 26 27 28 |
# File 'lib/rubarb/connection.rb', line 23 def connection_completed Rubarb::FastMessageProtocol.install(self) send_data("5") send_data(@id) @parent.connection_completed(self) if @parent end |
#post_init ⇒ Object
19 20 21 |
# File 'lib/rubarb/connection.rb', line 19 def post_init @buffer = "" end |
#receive_message(message) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/rubarb/connection.rb', line 30 def if ( == @id) self.extend(Rubarb::IncomingConnection) @on_connection.call if @on_connection else call_errbacks(ConnectionError.new("Handshake Failure")) end end |
#unbind ⇒ Object
39 40 41 |
# File 'lib/rubarb/connection.rb', line 39 def unbind @parent.connection_closed(self) end |