Method: AMQ::Client::Async::Adapter#handle_start

Defined in:
lib/amq/client/async/adapter.rb

#handle_start(connection_start) ⇒ Object

Handles connection.start.



599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
# File 'lib/amq/client/async/adapter.rb', line 599

def handle_start(connection_start)
  @server_properties                = connection_start.server_properties
  @server_capabilities              = @server_properties["capabilities"]

  @server_authentication_mechanisms = (connection_start.mechanisms || "").split(" ")
  @server_locales                   = Array(connection_start.locales)

  username = @settings[:user] || @settings[:username]
  password = @settings[:pass] || @settings[:password]

  # It's not clear whether we should transition to :opening state here
  # or in #open but in case authentication fails, it would be strange to have
  # @status undefined. So lets do this. MK.
  opening!

  self.send_frame(Protocol::Connection::StartOk.encode(@client_properties, mechanism, self.encode_credentials(username, password), @locale))
end