Skip to content

Commit dc67776

Browse files
committed
fix: timeout spec
1 parent d39d6fa commit dc67776

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

docs/API.org

+6-6
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Calling Process becomes the owner of the connection.
114114
{error, badarg | param_error | not_enough_mem | badpid}.
115115

116116
%% accept connection with timeout specified.
117-
-spec accept(listener_handler(), acceptor_opts(), timer:timeout()) ->
117+
-spec accept(listener_handler(), acceptor_opts(), timeout()) ->
118118
{ok, connection_handler()} |
119119
{error, badarg | param_error | not_enough_mem | badpid} |
120120
{error, timeout}.
@@ -134,7 +134,7 @@ Complete TLS handshake after accepted a Connection.
134134
#+begin_src erlang
135135

136136
%% Continue TLS handshake
137-
-spec handshake(connection_handler(), timer:timeout()) ->
137+
-spec handshake(connection_handler(), timeout()) ->
138138
ok |
139139
{error, badarg} |
140140
{error, atom_reason()}.
@@ -184,7 +184,7 @@ Close connection with flag specified and application reason code.
184184
-spec close_connection(connection_handler(),
185185
conn_close_flag(),
186186
app_errno(),
187-
timer:timeout().
187+
timeout().
188188
) -> ok.
189189

190190
%% Same as above with 5s timeout.
@@ -194,7 +194,7 @@ Close connection with flag specified and application reason code.
194194
) -> ok.
195195

196196
%% Same as above but close with flag: QUIC_CONNECTION_SHUTDOWN_FLAG_NONE and application error code 0
197-
-spec close_connection(connection_handler(), timer:timeout()) -> ok.
197+
-spec close_connection(connection_handler(), timeout()) -> ok.
198198

199199
#+end_src
200200

@@ -318,14 +318,14 @@ See ...
318318
-spec close_stream(stream_handler(),
319319
stream_close_flags(),
320320
app_errno(),
321-
time:timeout()) ->
321+
timeout()) ->
322322
ok |
323323
{error, badarg | atom_reason()}.
324324
{error, timeout}.
325325

326326
%% Close stream gracefully, with app_errno 0
327327
%% returns when both endpoints closed the stream
328-
-spec close_stream(stream_handler(), timer:timeout()) ->
328+
-spec close_stream(stream_handler(), timeout()) ->
329329
ok |
330330
{error, badarg | atom_reason()} |
331331
{error, timeout}.

src/quicer.erl

+9-9
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ connect(Host, Port, Opts, Timeout) when is_map(Opts) ->
169169
handshake(Conn) ->
170170
handshake(Conn, 1000).
171171

172-
-spec handshake(connection_handler(), timer:timeout()) -> ok | {error, any()}.
172+
-spec handshake(connection_handler(), timeout()) -> ok | {error, any()}.
173173
handshake(Conn, Timeout) ->
174174
case async_handshake(Conn) of
175175
{error, _} = E -> E;
@@ -190,7 +190,7 @@ async_handshake(Conn) ->
190190
accept(LSock, Opts) ->
191191
accept(LSock, Opts, infinity).
192192

193-
-spec accept(listener_handler(), acceptor_opts(), timer:timeout()) ->
193+
-spec accept(listener_handler(), acceptor_opts(), timeout()) ->
194194
{ok, connection_handler()} |
195195
{error, badarg | param_error | not_enough_mem | badpid} |
196196
{error, timeout}.
@@ -219,7 +219,7 @@ async_accept(Listener, Opts) ->
219219
shutdown_connection(Conn) ->
220220
shutdown_connection(Conn, 5000).
221221

222-
-spec shutdown_connection(connection_handler(), timer:timeout()) ->
222+
-spec shutdown_connection(connection_handler(), timeout()) ->
223223
ok | {error, timeout | badarg}.
224224
shutdown_connection(Conn, Timeout) ->
225225
shutdown_connection(Conn, ?QUIC_CONNECTION_SHUTDOWN_FLAG_NONE, 0, Timeout).
@@ -234,7 +234,7 @@ shutdown_connection(Conn, Flags, ErrorCode) ->
234234
-spec shutdown_connection(connection_handler(),
235235
conn_shutdown_flag(),
236236
app_errno(),
237-
timer:timeout()) -> ok | {error, timeout | badarg}.
237+
timeout()) -> ok | {error, timeout | badarg}.
238238
shutdown_connection(Conn, Flags, ErrorCode, Timeout) ->
239239
%% @todo make_ref
240240
case async_shutdown_connection(Conn, Flags, ErrorCode) of
@@ -269,7 +269,7 @@ close_connection(Conn, Flags, ErrorCode) ->
269269
-spec close_connection(connection_handler(),
270270
conn_shutdown_flag(),
271271
app_errno(),
272-
timer:timeout()) -> ok | {error, badarg | timeout}.
272+
timeout()) -> ok | {error, badarg | timeout}.
273273
close_connection(Conn, Flags, ErrorCode, Timeout) ->
274274
case shutdown_connection(Conn, Flags, ErrorCode, Timeout) of
275275
{error, _} = Err ->
@@ -409,7 +409,7 @@ send_dgram(Conn, Data) ->
409409
shutdown_stream(Stream) ->
410410
shutdown_stream(Stream, infinity).
411411

412-
-spec shutdown_stream(stream_handler(), timer:timeout()) ->
412+
-spec shutdown_stream(stream_handler(), timeout()) ->
413413
ok |
414414
{error, badarg} |
415415
{error, timeout}.
@@ -419,7 +419,7 @@ shutdown_stream(Stream, Timeout) ->
419419
-spec shutdown_stream(stream_handler(),
420420
stream_shutdown_flags(),
421421
app_errno(),
422-
time:timeout()) ->
422+
timeout()) ->
423423
ok |
424424
{error, badarg} |
425425
{error, timeout}.
@@ -458,7 +458,7 @@ close_stream(Stream) ->
458458
E
459459
end.
460460

461-
-spec close_stream(stream_handler(), timer:timeout())
461+
-spec close_stream(stream_handler(), timeout())
462462
-> ok | {error, badarg | timeout}.
463463
close_stream(Stream, Timeout) ->
464464
case shutdown_stream(Stream, Timeout) of
@@ -469,7 +469,7 @@ close_stream(Stream, Timeout) ->
469469
end.
470470

471471
-spec close_stream(stream_handler(), stream_shutdown_flags(),
472-
app_errno(), timer:timeout())
472+
app_errno(), timeout())
473473
-> ok | {error, badarg | timeout}.
474474
close_stream(Stream, Flags, ErrorCode, Timeout) ->
475475
case shutdown_stream(Stream, Flags, ErrorCode, Timeout) of

0 commit comments

Comments
 (0)