Module: Rubarb::OutgoingHandler

Includes:
ConnectionId, OutgoingConnection
Defined in:
lib/rubarb/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from OutgoingConnection

#cancel_keep_alive, #receive_message, #remote_call, #reset_keep_alive

Methods included from RemoteCall

#marshal_call, #unmarshal_call

Methods included from ConnectionId

#complete_id?, #extract_id

Instance Attribute Details

#apiObject

Returns the value of attribute api.



55
56
57
# File 'lib/rubarb/connection.rb', line 55

def api
  @api
end

#callbackObject

Returns the value of attribute callback.



56
57
58
# File 'lib/rubarb/connection.rb', line 56

def callback
  @callback
end

#hostObject

Returns the value of attribute host.



52
53
54
# File 'lib/rubarb/connection.rb', line 52

def host
  @host
end

#insecure_methodsObject

Returns the value of attribute insecure_methods.



58
59
60
# File 'lib/rubarb/connection.rb', line 58

def insecure_methods
  @insecure_methods
end

#keep_alive_timeObject

Returns the value of attribute keep_alive_time.



60
61
62
# File 'lib/rubarb/connection.rb', line 60

def keep_alive_time
  @keep_alive_time
end

#msg_id_generatorObject

Returns the value of attribute msg_id_generator.



57
58
59
# File 'lib/rubarb/connection.rb', line 57

def msg_id_generator
  @msg_id_generator
end

#on_connectionObject

Returns the value of attribute on_connection.



54
55
56
# File 'lib/rubarb/connection.rb', line 54

def on_connection
  @on_connection
end

#parentObject

Returns the value of attribute parent.



59
60
61
# File 'lib/rubarb/connection.rb', line 59

def parent
  @parent
end

#portObject

Returns the value of attribute port.



53
54
55
# File 'lib/rubarb/connection.rb', line 53

def port
  @port
end

Instance Method Details

#call_errbacks(message) ⇒ Object



83
84
85
# File 'lib/rubarb/connection.rb', line 83

def call_errbacks(message)
  @parent.call_errbacks(message)
end

#connection_completedObject



66
67
68
69
# File 'lib/rubarb/connection.rb', line 66

def connection_completed
  send_data("4")
  @parent.connection_completed(self) if @parent
end

#post_initObject



62
63
64
# File 'lib/rubarb/connection.rb', line 62

def post_init
  @buffer = ""
end

#receive_data(data) ⇒ Object



71
72
73
74
75
76
# File 'lib/rubarb/connection.rb', line 71

def receive_data data
  @buffer << data
  if @id.nil?
    handshake(@buffer)
  end
end

#unbindObject



78
79
80
81
# File 'lib/rubarb/connection.rb', line 78

def unbind
  cancel_keep_alive
  @parent.connection_closed(self)
end