# File lib/amqp/server.rb, line 45
    def process_frame frame
      channel = frame.channel

      case method = frame.payload
      when Protocol::Connection::StartOk
        @user = method.response[:LOGIN]
        @pass = method.response[:PASSWORD]
        send Protocol::Connection::Tune.new(0, 131072, 0)

      when Protocol::Connection::TuneOk
        # mnnk

      when Protocol::Connection::Open
        @vhost = method.virtual_host
        send Protocol::Connection::OpenOk.new('localhost')

      when Protocol::Channel::Open
        @channels[channel] = []
        send Protocol::Channel::OpenOk.new, :channel => channel

      when Protocol::Access::Request
        send Protocol::Access::RequestOk.new(101)
      end
    end