         close(state)
 
       nil ->
-        receive_message(state)
+        peek_first_byte(:disabled, nil, state)
 
       {optional, ssl_opts} when optional in [:required, :optional] ->
         peek_first_byte(optional, ssl_opts, state)

        finish_span(span, result: "tcp_rejected")
        close(state)

      {:ok, _non_ssl_header_byte} when optional == :optional ->
        finish_span(span, result: "tcp")
        receive_message(state)

      {:error, closed} when closed in [:closed, :econnreset, :timeout] ->
        finish_span(span, result: to_string(closed))


  @default_timeout 20_000
  @ssl_header_byte 0x16
  @tcp_header_byte 0x00

  @typedoc "A module that implements the :ranch_transport behaviour"
  @type transport :: :ranch_tcp
