Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add repeat_last_request functions #40

Closed
wants to merge 7 commits into from
Closed

Conversation

Noarkhh
Copy link
Contributor

@Noarkhh Noarkhh commented Aug 9, 2024

  • Add functions to repeat last sent request
  • Change default socket mode to active, so that if the peer closes connection the session process can receive a :tcp_closed message and terminate immediately

@Noarkhh Noarkhh force-pushed the allow-repeating-requests branch from 7ef3f2e to fd4f01e Compare August 9, 2024 11:25
@Noarkhh Noarkhh requested a review from mat-hek August 19, 2024 13:36
@Noarkhh Noarkhh self-assigned this Aug 21, 2024
Comment on lines +22 to +29
if is_port(socket), do: :inet.setopts(socket, active: false)

result =
with :ok <- mockable(:gen_tcp).send(socket, request) do
recv(socket, response_timeout)
end

if is_port(socket), do: :inet.setopts(socket, active: true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's create a dumb socket in tests and remove is_port checks here

def teardown(session, headers \\ []), do: request(session, "TEARDOWN", headers)

@spec repeat_last_request(t()) :: Response.result()
def repeat_last_request(session), do: GenServer.call(session, :repeat_last_request)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So instead, as we spoke, let's send the response from the TCP decapsulator back to the RTSP session and remove *_no_response functions

@Noarkhh Noarkhh closed this Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants