     socket_mod = state.socket_mod
     {:ok, s} = socket_mod.connect(state.host, state.port, state.options)
     :ok = Socket.send(s, @amqp_header)
+    Logger.info "connect: sent the header, now receiving the header"
     {:ok, @amqp_header} = Socket.recv(s, 8)
     Socket.set_opts(s, [packet: 4, active: :once])
-    Logger.info "connect: send header"
+    Logger.info "connect: got header"
     {:reply, :ok, %__MODULE__{state | socket: s, state: :hdr_exch}}
   end
   def handle_call({:close}, _from, state) do

    AmqpOne.Transport.Socket.set_active_once(state.socket)
    put_in state, :state, :hdr_exch
  end
  def connection(:hdr_rcvd, header = @amqp_header, state) do
    # this is currently a server state, our connection functions does
    # not allow this situation. Not tested!
    :ok = AmqpOne.Transport.Socket.send(state.socket, header)

  end

  @spec connection(conn_state_t, binary | %Frame{}, t) :: t
  def connection(:start, {tcp, @amqp_header}, state) do
    # this state is only relevant for being a server.
    # there is no attempt to deal with this situation for now.
    Socket.set_active_once(state.socket)
    put_in(state, :state, :hdr_rcvd)
  end
  def connection(:hdr_sent, %Frame{performative: :open} = f, state) do
