mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
feat(ext/net): add signal option to Deno.connect()
(#27113)
Ref #26819 An optional **timeout** parameter has been added to the **Deno.connect()** interface. This parameter allows specifying a timeout (in milliseconds) within which the application must establish a connection. If the timeout is exceeded without successfully connecting, the operation is automatically aborted with an error. If the parameter is not provided, the default behavior remains unchanged (no timeout). Currently, the timeout functionality is implemented only for TCP connections. Other connection types are not affected by this change. --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
This commit is contained in:
parent
1c6a2445c3
commit
f9a024a748
4 changed files with 86 additions and 14 deletions
3
cli/tsc/dts/lib.deno_net.d.ts
vendored
3
cli/tsc/dts/lib.deno_net.d.ts
vendored
|
@ -339,7 +339,10 @@ declare namespace Deno {
|
|||
*
|
||||
* @default {"127.0.0.1"} */
|
||||
hostname?: string;
|
||||
/** The transport layer protocol to use. */
|
||||
transport?: "tcp";
|
||||
/** An {@linkcode AbortSignal} to close the tcp connection. */
|
||||
signal?: AbortSignal;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue