   alias Thrift.Generator.ServiceTest.SimpleService.Binary.Framed.Client
   alias Thrift.Generator.ServiceTest.UsernameTakenException
 
-  def start_server(port, recv_timeout \\ :infinity) do
+  defp start_server(port, recv_timeout \\ :infinity) do
     :thrift_socket_server.start(
       handler: ServerSpy,
       port: port,

  end

  thrift_test "it returns :ok on void oneway functions if the server dies", ctx do
    Process.unlink(ctx.server)

    Process.flag(:trap_exit, true)
    ServerSpy.set_reply(:noreply)

    ref = Process.monitor(ctx.server)
    Process.exit(ctx.server, :normal)

    assert_receive {:DOWN, ^ref, _, _, _}
    assert_receive {:EXIT, _, {:error, :econnrefused}}, 100

    # this assertion is unusual, as it should exit, but the server

      socket_opts: [recv_timeout: recv_timeout])
  end

  defp stop_server(server_pid) when is_pid(server_pid) do
    ref = Process.monitor(server_pid)
    :thrift_socket_server.stop(server_pid)
    assert_receive {:DOWN, ^ref, _, _, _}
  end

  defp wait_for_exit(pid) when is_pid(pid) do
    ref = Process.monitor(pid)
    assert_receive {:DOWN, ^ref, _, _, _}
  end

  defp random_port do
    :erlang.unique_integer([:positive, :monotonic]) + 10_000
  end

