Skip to content

Commit

Permalink
chore: remove dead code and fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan committed Oct 30, 2024
1 parent 4b44430 commit 6275a79
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/quicer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
new_conn_props/0,
streams_available_props/0,
new_stream_props/0,
dgram_state/0,

%% Suporting types
error_code/0,
Expand Down Expand Up @@ -371,9 +372,8 @@ close_listener(Listener, Timeout) ->
timeout()
) ->
{ok, connection_handle()}
| {error, conn_open_error | config_error | conn_start_error}
| {error, timeout}
| {error, nst_not_found}.
| {error, conn_open_error | config_error | conn_start_error | timeout | nst_not_found}
| {error, transport_down, transport_shutdown_props()}.
connect(Host, Port, Opts, Timeout) when is_list(Opts) ->
connect(Host, Port, maps:from_list(Opts), Timeout);
connect(Host, Port, Opts, Timeout) when is_tuple(Host) ->
Expand All @@ -391,21 +391,12 @@ connect(Host, Port, Opts, Timeout) when is_map(Opts) ->
receive
{quic, connected, H, _} ->
{ok, H};
{quic, transport_shutdown, H, Reason} when
Reason == connection_timeout orelse
Reason == connection_idle
->
flush(closed, H),
{error, timeout};
{quic, transport_shutdown, H, Reason} ->
flush(closed, H),
{error, transport_down, Reason}
end;
{error, _} = Err ->
Err;
{error, not_found, _} ->
%% nst error
{error, nst_not_found}
Err
end.

%% @doc
Expand Down

0 comments on commit 6275a79

Please sign in to comment.