From 1a46ecc2c4f7fd23482fbaea85166cc1da8aab72 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Fri, 21 Mar 2025 15:35:46 +1100 Subject: [PATCH 01/23] feat: migration to ESM --- .eslintrc | 18 +- README.md | 2 +- benches/index.ts | 13 +- .../buffers/buffer_allocation.chart.html | 14 +- .../results/buffers/buffer_allocation.json | 1207 ++++++++--------- .../buffers/buffer_allocation_metrics.txt | 42 +- benches/results/metrics.txt | 52 +- .../results/streams/stream_1KiB.chart.html | 10 +- benches/results/streams/stream_1KiB.json | 132 +- .../streams/stream_1KiB_FFI.chart.html | 10 +- benches/results/streams/stream_1KiB_FFI.json | 182 +-- .../streams/stream_1KiB_FFI_metrics.txt | 4 +- .../results/streams/stream_1KiB_metrics.txt | 6 +- benches/results/system.json | 8 +- benches/suites/buffers/buffer_allocation.ts | 9 +- benches/suites/streams/stream_1KiB.ts | 19 +- benches/suites/streams/stream_1KiB_FFI.ts | 23 +- benches/utils.ts | 7 +- jest.config.js => jest.config.mjs | 27 +- package-lock.json | 702 ++++++++-- package.json | 55 +- scripts/{prebuild.js => prebuild.mjs} | 29 +- scripts/test.mjs | 48 + src/QUICClient.ts | 72 +- src/QUICConnection.ts | 82 +- src/QUICConnectionMap.ts | 4 +- src/QUICServer.ts | 57 +- src/QUICSocket.ts | 52 +- src/QUICStream.ts | 45 +- src/config.ts | 12 +- src/errors.ts | 4 +- src/events.ts | 8 +- src/index.ts | 24 +- src/native/index.ts | 6 +- src/native/quiche.ts | 9 +- src/native/types.ts | 2 +- src/types.ts | 8 +- src/utils.ts | 8 +- tests/QUICClient.test.ts | 868 ++++++------ tests/QUICConnectionId.test.ts | 6 +- tests/QUICServer.test.ts | 15 +- tests/QUICSocket.test.ts | 65 +- tests/QUICStream.test.ts | 35 +- tests/concurrency.test.ts | 74 +- tests/config.test.ts | 6 +- tests/native/connection.test.ts | 14 +- tests/native/quiche.test.ts | 9 +- tests/native/stream.test.ts | 15 +- tests/native/tls/ecdsa.test.ts | 16 +- tests/native/tls/ed25519.test.ts | 16 +- tests/native/tls/rsa.test.ts | 16 +- tests/setupAfterEnv.ts | 2 + tests/utils.test.ts | 4 +- tests/utils.ts | 12 +- tsconfig.json | 11 +- 55 files changed, 2362 insertions(+), 1834 deletions(-) rename jest.config.js => jest.config.mjs (78%) rename scripts/{prebuild.js => prebuild.mjs} (83%) create mode 100644 scripts/test.mjs diff --git a/.eslintrc b/.eslintrc index c9869cd0..05116a25 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,19 +7,18 @@ "jest": true }, "parser": "@typescript-eslint/parser", - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended", - "prettier" - ], - "plugins": [ - "import" - ], "parserOptions": { "project": "tsconfig.json", "sourceType": "module" }, + "plugins": [ + "import" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended" + ], "rules": { "linebreak-style": ["error", "unix"], "no-empty": 1, @@ -182,3 +181,4 @@ ] } } + diff --git a/README.md b/README.md index fef5ac81..3382819c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ npm run prebuild # build the dist and native objects npm run build # run the repl (this allows you to import from ./src) -npm run ts-node +npm run tsx # run the tests npm run test # lint the source code diff --git a/benches/index.ts b/benches/index.ts index 553f154f..6e870210 100644 --- a/benches/index.ts +++ b/benches/index.ts @@ -1,13 +1,16 @@ #!/usr/bin/env ts-node -import type { Summary } from 'benny/lib/internal/common-types'; +import type { Summary } from 'benny/lib/internal/common-types.js'; import fs from 'fs'; import path from 'path'; +import url from 'node:url'; import si from 'systeminformation'; -import { fsWalk, resultsPath, suitesPath } from './utils'; +import { fsWalk, resultsPath, suitesPath } from './utils.js'; + +const dirname = url.fileURLToPath(new URL('.', import.meta.url)); async function main(): Promise { - await fs.promises.mkdir(path.join(__dirname, 'results'), { recursive: true }); + await fs.promises.mkdir(path.join(dirname, 'results'), { recursive: true }); // Running all suites for await (const suitePath of fsWalk(suitesPath)) { // Skip over non-ts and non-js files @@ -44,12 +47,12 @@ async function main(): Promise { system: 'model, manufacturer', }); await fs.promises.writeFile( - path.join(__dirname, 'results', 'system.json'), + path.join(dirname, 'results', 'system.json'), JSON.stringify(systemData, null, 2), ); } -if (require.main === module) { +if (process.argv[1] === url.fileURLToPath(import.meta.url)) { void main(); } diff --git a/benches/results/buffers/buffer_allocation.chart.html b/benches/results/buffers/buffer_allocation.chart.html index fa03e13b..a45cb7e8 100644 --- a/benches/results/buffers/buffer_allocation.chart.html +++ b/benches/results/buffers/buffer_allocation.chart.html @@ -28,7 +28,7 @@
- +
+
+ +
+
+
+
+ +

Class ErrorQUICClientInvalidArgument<T>

+
+

Type Parameters

+
    +
  • +

    T

+
+

Hierarchy

+
+
+
+
+ +
+
+

Constructors

+
+
+

Properties

+
+
+

Accessors

+
+
+

Methods

+
+
+

Constructors

+
+ +
    + +
  • +
    +

    Type Parameters

    +
      +
    • +

      T

    +
    +

    Parameters

    +
      +
    • +
      Optional message: string
    • +
    • +
      Optional options: {
          cause?: T;
          data?: POJO;
          timestamp?: Date;
      }
      +
        +
      • +
        Optional cause?: T
      • +
      • +
        Optional data?: POJO
      • +
      • +
        Optional timestamp?: Date
    +

    Returns ErrorQUICClientInvalidArgument<T>

+
+

Properties

+
+ +
cause: T
+

Causation of the exception +Can be used to know what caused this exception

+
+
+
+ +
data: POJO
+

Arbitrary data

+
+
+
+ +
message: string
+
+ +
name: string
+
+ +
stack?: string
+
+ +
timestamp: Date
+

Timestamp when exception was constructed in milliseconds +Guaranteed to be weakly monotonic

+
+
+
+ +
description: string = 'QUIC Client had a failure relating to an invalid argument'
+
+ +
prepareStackTrace?: ((err, stackTraces) => any)
+
+

Type declaration

+
+
+ +
stackTraceLimit: number
+
+

Accessors

+
+ +
    +
  • get description(): string
  • +
  • +

    Returns string

+
+

Methods

+
+ +
    + +
  • +

    Encoding to JSON pojo +When overriding this, you can use super.toJSON +The replacer will:

    +
      +
    • delete undefined values in objects
    • +
    • replace undefined values for null in arrays
    • +
    +
    +

    Returns any

    +
+
+ +
    + +
  • +

    Create .stack property on a target object

    +
    +
    +

    Parameters

    +
      +
    • +
      targetObject: object
    • +
    • +
      Optional constructorOpt: Function
    +

    Returns void

    +
+
+ +
    + +
  • +

    Runtime decoding of JSON POJO to exception instance +When overriding this, you cannot use super.fromJSON +You must write it fully, and use the same type-hacks +to support polymorphic this in static methods +https://github.com/microsoft/TypeScript/issues/5863

    +
    +
    +

    Type Parameters

    +
      +
    • +

      T extends Class<any>

    +
    +

    Parameters

    +
      +
    • +
      this: T
    • +
    • +
      json: any
    +

    Returns InstanceType<T>

    +
+
+ +
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/classes/errors.ErrorQUICClientInvalidHost.html b/docs/classes/errors.ErrorQUICClientInvalidHost.html index bb1ebc1b..29a677de 100644 --- a/docs/classes/errors.ErrorQUICClientInvalidHost.html +++ b/docs/classes/errors.ErrorQUICClientInvalidHost.html @@ -28,7 +28,7 @@

Hierarchy

  • ErrorQUICClientInvalidHost
+
  • Defined in src/errors.ts:71
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:72
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICClientSocketNotRunning.html b/docs/classes/errors.ErrorQUICClientSocketNotRunning.html index fe559bd2..46295fbd 100644 --- a/docs/classes/errors.ErrorQUICClientSocketNotRunning.html +++ b/docs/classes/errors.ErrorQUICClientSocketNotRunning.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICClientSocketNotRunning
    +
  • Defined in src/errors.ts:61
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:62
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConfig.html b/docs/classes/errors.ErrorQUICConfig.html index a026fea8..9d07ec06 100644 --- a/docs/classes/errors.ErrorQUICConfig.html +++ b/docs/classes/errors.ErrorQUICConfig.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConfig
    +
  • Defined in src/errors.ts:21
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:22
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnection.html b/docs/classes/errors.ErrorQUICConnection.html index b6bca7e1..d46c7c81 100644 --- a/docs/classes/errors.ErrorQUICConnection.html +++ b/docs/classes/errors.ErrorQUICConnection.html @@ -28,6 +28,7 @@

    Hierarchy

    +
  • Defined in src/errors.ts:104
  • @@ -153,7 +154,7 @@
    +
  • Defined in src/errors.ts:105
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -309,6 +310,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -324,6 +326,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -331,6 +334,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -340,10 +344,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionClosed.html b/docs/classes/errors.ErrorQUICConnectionClosed.html index c1eda621..ccba2dbd 100644 --- a/docs/classes/errors.ErrorQUICConnectionClosed.html +++ b/docs/classes/errors.ErrorQUICConnectionClosed.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionClosed
    +
  • Defined in src/errors.ts:116
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:117
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionConfigInvalid.html b/docs/classes/errors.ErrorQUICConnectionConfigInvalid.html index 5d5f144d..37212d79 100644 --- a/docs/classes/errors.ErrorQUICConnectionConfigInvalid.html +++ b/docs/classes/errors.ErrorQUICConnectionConfigInvalid.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionConfigInvalid
    +
  • Defined in src/errors.ts:130
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:131
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionIdleTimeout.html b/docs/classes/errors.ErrorQUICConnectionIdleTimeout.html index 04ba3eca..270c807a 100644 --- a/docs/classes/errors.ErrorQUICConnectionIdleTimeout.html +++ b/docs/classes/errors.ErrorQUICConnectionIdleTimeout.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionIdleTimeout
    +
  • Defined in src/errors.ts:206
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:207
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionInternal.html b/docs/classes/errors.ErrorQUICConnectionInternal.html index 310c2fdc..f4e85a79 100644 --- a/docs/classes/errors.ErrorQUICConnectionInternal.html +++ b/docs/classes/errors.ErrorQUICConnectionInternal.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionInternal
    +
  • Defined in src/errors.ts:210
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:211
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionLocal.html b/docs/classes/errors.ErrorQUICConnectionLocal.html index 1d07e0ca..a42cadc1 100644 --- a/docs/classes/errors.ErrorQUICConnectionLocal.html +++ b/docs/classes/errors.ErrorQUICConnectionLocal.html @@ -31,7 +31,7 @@

    Hierarchy

  • ErrorQUICConnectionLocalTLS
  • ErrorQUICConnectionPeerTLS
  • +
  • Defined in src/errors.ts:134
  • @@ -92,7 +92,7 @@
    Optional Returns ErrorQUICConnectionLocal<T>
    +
  • Defined in src/errors.ts:137
  • Properties

    @@ -113,7 +113,7 @@
    +
  • Defined in src/errors.ts:136
  • message: string
    +
  • Defined in src/errors.ts:135
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -303,6 +303,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -318,6 +319,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -325,6 +327,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -334,10 +337,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionLocalTLS.html b/docs/classes/errors.ErrorQUICConnectionLocalTLS.html index 8233cf38..7f08ea43 100644 --- a/docs/classes/errors.ErrorQUICConnectionLocalTLS.html +++ b/docs/classes/errors.ErrorQUICConnectionLocalTLS.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionLocalTLS
    +
  • Defined in src/errors.ts:149
  • @@ -89,7 +89,7 @@
    Optional Returns ErrorQUICConnectionLocalTLS<T>
    +
  • Defined in src/errors.ts:155
  • Properties

    @@ -115,7 +115,7 @@
    errorCode
    +
  • Defined in src/errors.ts:151
  • message: string
    +
  • Defined in src/errors.ts:150
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -305,6 +305,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -320,6 +321,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -327,6 +329,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -336,10 +339,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionNotRunning.html b/docs/classes/errors.ErrorQUICConnectionNotRunning.html index 0391962e..9d53088e 100644 --- a/docs/classes/errors.ErrorQUICConnectionNotRunning.html +++ b/docs/classes/errors.ErrorQUICConnectionNotRunning.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionNotRunning
    +
  • Defined in src/errors.ts:112
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:113
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionPeer.html b/docs/classes/errors.ErrorQUICConnectionPeer.html index 3645c7ef..bbdb15af 100644 --- a/docs/classes/errors.ErrorQUICConnectionPeer.html +++ b/docs/classes/errors.ErrorQUICConnectionPeer.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionPeer
    +
  • Defined in src/errors.ts:170
  • @@ -89,7 +89,7 @@
    Optional Returns ErrorQUICConnectionPeer<T>
    +
  • Defined in src/errors.ts:173
  • Properties

    @@ -110,7 +110,7 @@
    +
  • Defined in src/errors.ts:172
  • message: string
    +
  • Defined in src/errors.ts:171
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionPeerTLS.html b/docs/classes/errors.ErrorQUICConnectionPeerTLS.html index e6cc1c55..58f75ddd 100644 --- a/docs/classes/errors.ErrorQUICConnectionPeerTLS.html +++ b/docs/classes/errors.ErrorQUICConnectionPeerTLS.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionPeerTLS
    +
  • Defined in src/errors.ts:185
  • @@ -89,7 +89,7 @@
    Optional Returns ErrorQUICConnectionPeerTLS<T>
    +
  • Defined in src/errors.ts:191
  • Properties

    @@ -115,7 +115,7 @@
    errorCode
    +
  • Defined in src/errors.ts:187
  • message: string
    +
  • Defined in src/errors.ts:186
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -305,6 +305,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -320,6 +321,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -327,6 +329,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -336,10 +339,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionStartData.html b/docs/classes/errors.ErrorQUICConnectionStartData.html index 1688f2e4..1eef7615 100644 --- a/docs/classes/errors.ErrorQUICConnectionStartData.html +++ b/docs/classes/errors.ErrorQUICConnectionStartData.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionStartData
    +
  • Defined in src/errors.ts:121
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:122
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionStartTimeout.html b/docs/classes/errors.ErrorQUICConnectionStartTimeout.html index cdc1ae55..2d24ceb5 100644 --- a/docs/classes/errors.ErrorQUICConnectionStartTimeout.html +++ b/docs/classes/errors.ErrorQUICConnectionStartTimeout.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICConnectionStartTimeout
    +
  • Defined in src/errors.ts:126
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:127
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICConnectionStopping.html b/docs/classes/errors.ErrorQUICConnectionStopping.html new file mode 100644 index 00000000..8e188402 --- /dev/null +++ b/docs/classes/errors.ErrorQUICConnectionStopping.html @@ -0,0 +1,380 @@ +ErrorQUICConnectionStopping | @matrixai/quic
    +
    + +
    +
    +
    +
    + +

    Class ErrorQUICConnectionStopping<T>

    +
    +

    Type Parameters

    +
      +
    • +

      T

    +
    +

    Hierarchy

    +
    +
    +
    +
    + +
    +
    +

    Constructors

    +
    +
    +

    Properties

    +
    +
    +

    Accessors

    +
    +
    +

    Methods

    +
    +
    +

    Constructors

    +
    + +
      + +
    • +
      +

      Type Parameters

      +
        +
      • +

        T

      +
      +

      Parameters

      +
        +
      • +
        Optional message: string
      • +
      • +
        Optional options: {
            cause?: T;
            data?: POJO;
            timestamp?: Date;
        }
        +
          +
        • +
          Optional cause?: T
        • +
        • +
          Optional data?: POJO
        • +
        • +
          Optional timestamp?: Date
      +

      Returns ErrorQUICConnectionStopping<T>

    +
    +

    Properties

    +
    + +
    cause: T
    +

    Causation of the exception +Can be used to know what caused this exception

    +
    +
    +
    + +
    data: POJO
    +

    Arbitrary data

    +
    +
    +
    + +
    message: string
    +
    + +
    name: string
    +
    + +
    stack?: string
    +
    + +
    timestamp: Date
    +

    Timestamp when exception was constructed in milliseconds +Guaranteed to be weakly monotonic

    +
    +
    +
    + +
    description: string = 'QUIC Connection is stopping'
    +
    + +
    prepareStackTrace?: ((err, stackTraces) => any)
    +
    +

    Type declaration

    +
    +
    + +
    stackTraceLimit: number
    +
    +

    Accessors

    +
    + +
      +
    • get description(): string
    • +
    • +

      Returns string

    +
    +

    Methods

    +
    + +
      + +
    • +

      Encoding to JSON pojo +When overriding this, you can use super.toJSON +The replacer will:

      +
        +
      • delete undefined values in objects
      • +
      • replace undefined values for null in arrays
      • +
      +
      +

      Returns any

      +
    +
    + +
      + +
    • +

      Create .stack property on a target object

      +
      +
      +

      Parameters

      +
        +
      • +
        targetObject: object
      • +
      • +
        Optional constructorOpt: Function
      +

      Returns void

      +
    +
    + +
      + +
    • +

      Runtime decoding of JSON POJO to exception instance +When overriding this, you cannot use super.fromJSON +You must write it fully, and use the same type-hacks +to support polymorphic this in static methods +https://github.com/microsoft/TypeScript/issues/5863

      +
      +
      +

      Type Parameters

      +
        +
      • +

        T extends Class<any>

      +
      +

      Parameters

      +
        +
      • +
        this: T
      • +
      • +
        json: any
      +

      Returns InstanceType<T>

      +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file diff --git a/docs/classes/errors.ErrorQUICHostInvalid.html b/docs/classes/errors.ErrorQUICHostInvalid.html index 945f5ced..a128a1ae 100644 --- a/docs/classes/errors.ErrorQUICHostInvalid.html +++ b/docs/classes/errors.ErrorQUICHostInvalid.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICHostInvalid
    +
  • Defined in src/errors.ts:13
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:14
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICPortInvalid.html b/docs/classes/errors.ErrorQUICPortInvalid.html index 7e7852f5..77f6535b 100644 --- a/docs/classes/errors.ErrorQUICPortInvalid.html +++ b/docs/classes/errors.ErrorQUICPortInvalid.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICPortInvalid
    +
  • Defined in src/errors.ts:17
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:18
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICServer.html b/docs/classes/errors.ErrorQUICServer.html index 300d0404..0c9ccfdd 100644 --- a/docs/classes/errors.ErrorQUICServer.html +++ b/docs/classes/errors.ErrorQUICServer.html @@ -31,9 +31,10 @@

    Hierarchy

  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • ErrorQUICServerNewConnection
  • -
  • ErrorQUICServerInternal
  • @@ -149,7 +150,7 @@
    +
  • Defined in src/errors.ts:80
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -305,6 +306,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -320,6 +322,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -327,6 +330,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -336,10 +340,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICServerInternal.html b/docs/classes/errors.ErrorQUICServerInternal.html index 3e2a3d95..47a217ac 100644 --- a/docs/classes/errors.ErrorQUICServerInternal.html +++ b/docs/classes/errors.ErrorQUICServerInternal.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICServerInternal
    +
  • Defined in src/errors.ts:96
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:97
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICServerNewConnection.html b/docs/classes/errors.ErrorQUICServerNewConnection.html index c3d41c9f..97c9db5c 100644 --- a/docs/classes/errors.ErrorQUICServerNewConnection.html +++ b/docs/classes/errors.ErrorQUICServerNewConnection.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICServerNewConnection
    +
  • Defined in src/errors.ts:92
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:93
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICServerNotRunning.html b/docs/classes/errors.ErrorQUICServerNotRunning.html index c630b272..23c6b2e4 100644 --- a/docs/classes/errors.ErrorQUICServerNotRunning.html +++ b/docs/classes/errors.ErrorQUICServerNotRunning.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICServerNotRunning
    +
  • Defined in src/errors.ts:83
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:84
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICServerSocketNotRunning.html b/docs/classes/errors.ErrorQUICServerSocketNotRunning.html index 7c614a0e..b834e535 100644 --- a/docs/classes/errors.ErrorQUICServerSocketNotRunning.html +++ b/docs/classes/errors.ErrorQUICServerSocketNotRunning.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICServerSocketNotRunning
    +
  • Defined in src/errors.ts:87
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:88
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICServerStopping.html b/docs/classes/errors.ErrorQUICServerStopping.html new file mode 100644 index 00000000..45193104 --- /dev/null +++ b/docs/classes/errors.ErrorQUICServerStopping.html @@ -0,0 +1,380 @@ +ErrorQUICServerStopping | @matrixai/quic
    +
    + +
    +
    +
    +
    + +

    Class ErrorQUICServerStopping<T>

    +
    +

    Type Parameters

    +
      +
    • +

      T

    +
    +

    Hierarchy

    +
    +
    +
    +
    + +
    +
    +

    Constructors

    +
    +
    +

    Properties

    +
    +
    +

    Accessors

    +
    +
    +

    Methods

    +
    +
    +

    Constructors

    +
    + +
      + +
    • +
      +

      Type Parameters

      +
        +
      • +

        T

      +
      +

      Parameters

      +
        +
      • +
        Optional message: string
      • +
      • +
        Optional options: {
            cause?: T;
            data?: POJO;
            timestamp?: Date;
        }
        +
          +
        • +
          Optional cause?: T
        • +
        • +
          Optional data?: POJO
        • +
        • +
          Optional timestamp?: Date
      +

      Returns ErrorQUICServerStopping<T>

    +
    +

    Properties

    +
    + +
    cause: T
    +

    Causation of the exception +Can be used to know what caused this exception

    +
    +
    +
    + +
    data: POJO
    +

    Arbitrary data

    +
    +
    +
    + +
    message: string
    +
    + +
    name: string
    +
    + +
    stack?: string
    +
    + +
    timestamp: Date
    +

    Timestamp when exception was constructed in milliseconds +Guaranteed to be weakly monotonic

    +
    +
    +
    + +
    description: string = 'QUIC Server is stopping'
    +
    + +
    prepareStackTrace?: ((err, stackTraces) => any)
    +
    +

    Type declaration

    +
    +
    + +
    stackTraceLimit: number
    +
    +

    Accessors

    +
    + +
      +
    • get description(): string
    • +
    • +

      Returns string

    +
    +

    Methods

    +
    + +
      + +
    • +

      Encoding to JSON pojo +When overriding this, you can use super.toJSON +The replacer will:

      +
        +
      • delete undefined values in objects
      • +
      • replace undefined values for null in arrays
      • +
      +
      +

      Returns any

      +
    +
    + +
      + +
    • +

      Create .stack property on a target object

      +
      +
      +

      Parameters

      +
        +
      • +
        targetObject: object
      • +
      • +
        Optional constructorOpt: Function
      +

      Returns void

      +
    +
    + +
      + +
    • +

      Runtime decoding of JSON POJO to exception instance +When overriding this, you cannot use super.fromJSON +You must write it fully, and use the same type-hacks +to support polymorphic this in static methods +https://github.com/microsoft/TypeScript/issues/5863

      +
      +
      +

      Type Parameters

      +
        +
      • +

        T extends Class<any>

      +
      +

      Parameters

      +
        +
      • +
        this: T
      • +
      • +
        json: any
      +

      Returns InstanceType<T>

      +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file diff --git a/docs/classes/errors.ErrorQUICSocket.html b/docs/classes/errors.ErrorQUICSocket.html index 7b84ee0a..d3b0c1cd 100644 --- a/docs/classes/errors.ErrorQUICSocket.html +++ b/docs/classes/errors.ErrorQUICSocket.html @@ -34,7 +34,7 @@

    Hierarchy

  • ErrorQUICSocketInvalidSendAddress
  • ErrorQUICSocketInternal
  • +
  • Defined in src/errors.ts:25
  • @@ -150,7 +150,7 @@
    +
  • Defined in src/errors.ts:26
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -306,6 +306,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -321,6 +322,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -328,6 +330,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -337,10 +340,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICSocketConnectionsActive.html b/docs/classes/errors.ErrorQUICSocketConnectionsActive.html index ad4a71a3..f95c99eb 100644 --- a/docs/classes/errors.ErrorQUICSocketConnectionsActive.html +++ b/docs/classes/errors.ErrorQUICSocketConnectionsActive.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICSocketConnectionsActive
    +
  • Defined in src/errors.ts:33
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:34
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICSocketInternal.html b/docs/classes/errors.ErrorQUICSocketInternal.html index 380786d6..145ef828 100644 --- a/docs/classes/errors.ErrorQUICSocketInternal.html +++ b/docs/classes/errors.ErrorQUICSocketInternal.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICSocketInternal
    +
  • Defined in src/errors.ts:45
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:46
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICSocketInvalidBindAddress.html b/docs/classes/errors.ErrorQUICSocketInvalidBindAddress.html index ae096817..aee45b49 100644 --- a/docs/classes/errors.ErrorQUICSocketInvalidBindAddress.html +++ b/docs/classes/errors.ErrorQUICSocketInvalidBindAddress.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICSocketInvalidBindAddress
    +
  • Defined in src/errors.ts:37
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:38
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICSocketInvalidSendAddress.html b/docs/classes/errors.ErrorQUICSocketInvalidSendAddress.html index 68e62dd6..1a1fff5f 100644 --- a/docs/classes/errors.ErrorQUICSocketInvalidSendAddress.html +++ b/docs/classes/errors.ErrorQUICSocketInvalidSendAddress.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICSocketInvalidSendAddress
    +
  • Defined in src/errors.ts:41
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:42
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICSocketNotRunning.html b/docs/classes/errors.ErrorQUICSocketNotRunning.html index ac3437b8..e9be6046 100644 --- a/docs/classes/errors.ErrorQUICSocketNotRunning.html +++ b/docs/classes/errors.ErrorQUICSocketNotRunning.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICSocketNotRunning
    +
  • Defined in src/errors.ts:29
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:30
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICStream.html b/docs/classes/errors.ErrorQUICStream.html index aecaa76a..06232b7c 100644 --- a/docs/classes/errors.ErrorQUICStream.html +++ b/docs/classes/errors.ErrorQUICStream.html @@ -33,9 +33,10 @@

    Hierarchy

  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • ErrorQUICStreamPeerWrite
  • -
  • ErrorQUICStreamInternal
  • @@ -151,7 +152,7 @@
    +
  • Defined in src/errors.ts:215
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -307,6 +308,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -322,6 +324,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -329,6 +332,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -338,10 +342,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICStreamDestroyed.html b/docs/classes/errors.ErrorQUICStreamDestroyed.html index 0e4ced4c..37afa2d0 100644 --- a/docs/classes/errors.ErrorQUICStreamDestroyed.html +++ b/docs/classes/errors.ErrorQUICStreamDestroyed.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICStreamDestroyed
    +
  • Defined in src/errors.ts:218
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:219
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICStreamInternal.html b/docs/classes/errors.ErrorQUICStreamInternal.html index 696eac47..837b9f78 100644 --- a/docs/classes/errors.ErrorQUICStreamInternal.html +++ b/docs/classes/errors.ErrorQUICStreamInternal.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICStreamInternal
    +
  • Defined in src/errors.ts:290
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:291
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -300,6 +300,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -315,6 +316,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -322,6 +324,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -331,10 +334,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICStreamLimit.html b/docs/classes/errors.ErrorQUICStreamLimit.html new file mode 100644 index 00000000..afed990a --- /dev/null +++ b/docs/classes/errors.ErrorQUICStreamLimit.html @@ -0,0 +1,380 @@ +ErrorQUICStreamLimit | @matrixai/quic
    +
    + +
    +
    +
    +
    + +

    Class ErrorQUICStreamLimit<T>

    +
    +

    Type Parameters

    +
      +
    • +

      T

    +
    +

    Hierarchy

    +
    +
    +
    +
    + +
    +
    +

    Constructors

    +
    +
    +

    Properties

    +
    +
    +

    Accessors

    +
    +
    +

    Methods

    +
    +
    +

    Constructors

    +
    + +
      + +
    • +
      +

      Type Parameters

      +
        +
      • +

        T

      +
      +

      Parameters

      +
        +
      • +
        Optional message: string
      • +
      • +
        Optional options: {
            cause?: T;
            data?: POJO;
            timestamp?: Date;
        }
        +
          +
        • +
          Optional cause?: T
        • +
        • +
          Optional data?: POJO
        • +
        • +
          Optional timestamp?: Date
      +

      Returns ErrorQUICStreamLimit<T>

    +
    +

    Properties

    +
    + +
    cause: T
    +

    Causation of the exception +Can be used to know what caused this exception

    +
    +
    +
    + +
    data: POJO
    +

    Arbitrary data

    +
    +
    +
    + +
    message: string
    +
    + +
    name: string
    +
    + +
    stack?: string
    +
    + +
    timestamp: Date
    +

    Timestamp when exception was constructed in milliseconds +Guaranteed to be weakly monotonic

    +
    +
    +
    + +
    description: string = 'QUIC Stream limit has been reached'
    +
    + +
    prepareStackTrace?: ((err, stackTraces) => any)
    +
    +

    Type declaration

    +
    +
    + +
    stackTraceLimit: number
    +
    +

    Accessors

    +
    + +
      +
    • get description(): string
    • +
    • +

      Returns string

    +
    +

    Methods

    +
    + +
      + +
    • +

      Encoding to JSON pojo +When overriding this, you can use super.toJSON +The replacer will:

      +
        +
      • delete undefined values in objects
      • +
      • replace undefined values for null in arrays
      • +
      +
      +

      Returns any

      +
    +
    + +
      + +
    • +

      Create .stack property on a target object

      +
      +
      +

      Parameters

      +
        +
      • +
        targetObject: object
      • +
      • +
        Optional constructorOpt: Function
      +

      Returns void

      +
    +
    + +
      + +
    • +

      Runtime decoding of JSON POJO to exception instance +When overriding this, you cannot use super.fromJSON +You must write it fully, and use the same type-hacks +to support polymorphic this in static methods +https://github.com/microsoft/TypeScript/issues/5863

      +
      +
      +

      Type Parameters

      +
        +
      • +

        T extends Class<any>

      +
      +

      Parameters

      +
        +
      • +
        this: T
      • +
      • +
        json: any
      +

      Returns InstanceType<T>

      +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file diff --git a/docs/classes/errors.ErrorQUICStreamLocalRead.html b/docs/classes/errors.ErrorQUICStreamLocalRead.html index d99d2b86..b0c1a81a 100644 --- a/docs/classes/errors.ErrorQUICStreamLocalRead.html +++ b/docs/classes/errors.ErrorQUICStreamLocalRead.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICStreamLocalRead
    +
  • Defined in src/errors.ts:222
  • @@ -89,7 +89,7 @@
    Optional Returns ErrorQUICStreamLocalRead<T>
    +
  • Defined in src/errors.ts:225
  • Properties

    @@ -115,7 +115,7 @@
    code
    +
  • Defined in src/errors.ts:224
  • message: string
    +
  • Defined in src/errors.ts:223
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -305,6 +305,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -320,6 +321,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -327,6 +329,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -336,10 +339,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICStreamLocalWrite.html b/docs/classes/errors.ErrorQUICStreamLocalWrite.html index d5e8d38f..786693ad 100644 --- a/docs/classes/errors.ErrorQUICStreamLocalWrite.html +++ b/docs/classes/errors.ErrorQUICStreamLocalWrite.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICStreamLocalWrite
    +
  • Defined in src/errors.ts:239
  • @@ -89,7 +89,7 @@
    Optional Returns ErrorQUICStreamLocalWrite<T>
    +
  • Defined in src/errors.ts:242
  • Properties

    @@ -115,7 +115,7 @@
    code
    +
  • Defined in src/errors.ts:241
  • message: string
    +
  • Defined in src/errors.ts:240
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -305,6 +305,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -320,6 +321,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -327,6 +329,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -336,10 +339,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICStreamPeerRead.html b/docs/classes/errors.ErrorQUICStreamPeerRead.html index 25bc7933..fe5d19d0 100644 --- a/docs/classes/errors.ErrorQUICStreamPeerRead.html +++ b/docs/classes/errors.ErrorQUICStreamPeerRead.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICStreamPeerRead
    +
  • Defined in src/errors.ts:256
  • @@ -89,7 +89,7 @@
    Optional Returns ErrorQUICStreamPeerRead<T>
    +
  • Defined in src/errors.ts:259
  • Properties

    @@ -115,7 +115,7 @@
    code
    +
  • Defined in src/errors.ts:258
  • message: string
    +
  • Defined in src/errors.ts:257
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -305,6 +305,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -320,6 +321,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -327,6 +329,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -336,10 +339,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICStreamPeerWrite.html b/docs/classes/errors.ErrorQUICStreamPeerWrite.html index 39df8aba..5d45fe07 100644 --- a/docs/classes/errors.ErrorQUICStreamPeerWrite.html +++ b/docs/classes/errors.ErrorQUICStreamPeerWrite.html @@ -28,7 +28,7 @@

    Hierarchy

    • ErrorQUICStreamPeerWrite
    +
  • Defined in src/errors.ts:273
  • @@ -89,7 +89,7 @@
    Optional Returns ErrorQUICStreamPeerWrite<T>
    +
  • Defined in src/errors.ts:276
  • Properties

    @@ -115,7 +115,7 @@
    code
    +
  • Defined in src/errors.ts:275
  • message: string
    +
  • Defined in src/errors.ts:274
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -305,6 +305,7 @@

    ErrorQUICClientCreateTimeout
  • ErrorQUICClientDestroyed
  • ErrorQUICClientInternal
  • +
  • ErrorQUICClientInvalidArgument
  • ErrorQUICClientInvalidHost
  • ErrorQUICClientSocketNotRunning
  • ErrorQUICConfig
  • @@ -320,6 +321,7 @@

    ErrorQUICConnectionPeerTLS
  • ErrorQUICConnectionStartData
  • ErrorQUICConnectionStartTimeout
  • +
  • ErrorQUICConnectionStopping
  • ErrorQUICHostInvalid
  • ErrorQUICPortInvalid
  • ErrorQUICServer
  • @@ -327,6 +329,7 @@

    ErrorQUICServerNewConnection
  • ErrorQUICServerNotRunning
  • ErrorQUICServerSocketNotRunning
  • +
  • ErrorQUICServerStopping
  • ErrorQUICSocket
  • ErrorQUICSocketConnectionsActive
  • ErrorQUICSocketInternal
  • @@ -336,10 +339,12 @@

    ErrorQUICStream
  • ErrorQUICStreamDestroyed
  • ErrorQUICStreamInternal
  • +
  • ErrorQUICStreamLimit
  • ErrorQUICStreamLocalRead
  • ErrorQUICStreamLocalWrite
  • ErrorQUICStreamPeerRead
  • -
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/classes/errors.ErrorQUICUndefinedBehaviour.html b/docs/classes/errors.ErrorQUICUndefinedBehaviour.html new file mode 100644 index 00000000..a3dd6c98 --- /dev/null +++ b/docs/classes/errors.ErrorQUICUndefinedBehaviour.html @@ -0,0 +1,380 @@ +ErrorQUICUndefinedBehaviour | @matrixai/quic
    +
    + +
    +
    +
    +
    + +

    Class ErrorQUICUndefinedBehaviour<T>

    +
    +

    Type Parameters

    +
      +
    • +

      T

    +
    +

    Hierarchy

    +
      +
    • AbstractError<T> +
        +
      • ErrorQUICUndefinedBehaviour
    +
    +
    +
    + +
    +
    +

    Constructors

    +
    +
    +

    Properties

    +
    +
    +

    Accessors

    +
    +
    +

    Methods

    +
    +
    +

    Constructors

    +
    + +
      + +
    • +
      +

      Type Parameters

      +
        +
      • +

        T

      +
      +

      Parameters

      +
        +
      • +
        Optional message: string
      • +
      • +
        Optional options: {
            cause?: T;
            data?: POJO;
            timestamp?: Date;
        }
        +
          +
        • +
          Optional cause?: T
        • +
        • +
          Optional data?: POJO
        • +
        • +
          Optional timestamp?: Date
      +

      Returns ErrorQUICUndefinedBehaviour<T>

    +
    +

    Properties

    +
    + +
    cause: T
    +

    Causation of the exception +Can be used to know what caused this exception

    +
    +
    +
    + +
    data: POJO
    +

    Arbitrary data

    +
    +
    +
    + +
    message: string
    +
    + +
    name: string
    +
    + +
    stack?: string
    +
    + +
    timestamp: Date
    +

    Timestamp when exception was constructed in milliseconds +Guaranteed to be weakly monotonic

    +
    +
    +
    + +
    description: string = 'You should never see this error'
    +
    + +
    prepareStackTrace?: ((err, stackTraces) => any)
    +
    +

    Type declaration

    +
    +
    + +
    stackTraceLimit: number
    +
    +

    Accessors

    +
    + +
      +
    • get description(): string
    • +
    • +

      Returns string

    +
    +

    Methods

    +
    + +
      + +
    • +

      Encoding to JSON pojo +When overriding this, you can use super.toJSON +The replacer will:

      +
        +
      • delete undefined values in objects
      • +
      • replace undefined values for null in arrays
      • +
      +
      +

      Returns any

      +
    +
    + +
      + +
    • +

      Create .stack property on a target object

      +
      +
      +

      Parameters

      +
        +
      • +
        targetObject: object
      • +
      • +
        Optional constructorOpt: Function
      +

      Returns void

      +
    +
    + +
      + +
    • +

      Runtime decoding of JSON POJO to exception instance +When overriding this, you cannot use super.fromJSON +You must write it fully, and use the same type-hacks +to support polymorphic this in static methods +https://github.com/microsoft/TypeScript/issues/5863

      +
      +
      +

      Type Parameters

      +
        +
      • +

        T extends Class<any>

      +
      +

      Parameters

      +
        +
      • +
        this: T
      • +
      • +
        json: any
      +

      Returns InstanceType<T>

      +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file diff --git a/docs/classes/events.EventQUIC.html b/docs/classes/events.EventQUIC.html index f0898417..1b730aca 100644 --- a/docs/classes/events.EventQUIC.html +++ b/docs/classes/events.EventQUIC.html @@ -463,6 +463,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICClient.html b/docs/classes/events.EventQUICClient.html index c2167557..299bf552 100644 --- a/docs/classes/events.EventQUICClient.html +++ b/docs/classes/events.EventQUICClient.html @@ -462,6 +462,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICClientClose.html b/docs/classes/events.EventQUICClientClose.html index 74cfa7df..56b3dfed 100644 --- a/docs/classes/events.EventQUICClientClose.html +++ b/docs/classes/events.EventQUICClientClose.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICClientClose
    +
  • Defined in src/events.ts:67
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICClientDestroy.html b/docs/classes/events.EventQUICClientDestroy.html index 1e0de073..76a4dcf8 100644 --- a/docs/classes/events.EventQUICClientDestroy.html +++ b/docs/classes/events.EventQUICClientDestroy.html @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICClientDestroyed.html b/docs/classes/events.EventQUICClientDestroyed.html index e862fc6a..0f98e8ed 100644 --- a/docs/classes/events.EventQUICClientDestroyed.html +++ b/docs/classes/events.EventQUICClientDestroyed.html @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICClientError.html b/docs/classes/events.EventQUICClientError.html index a8e63352..b68b5f57 100644 --- a/docs/classes/events.EventQUICClientError.html +++ b/docs/classes/events.EventQUICClientError.html @@ -448,6 +448,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICClientErrorSend.html b/docs/classes/events.EventQUICClientErrorSend.html new file mode 100644 index 00000000..5a9ec429 --- /dev/null +++ b/docs/classes/events.EventQUICClientErrorSend.html @@ -0,0 +1,513 @@ +EventQUICClientErrorSend | @matrixai/quic
    +
    + +
    +
    +
    +
    + +

    Class EventQUICClientErrorSend

    +
    +

    Hierarchy

    +
    +
    +
    +
    + +
    +
    +

    Constructors

    +
    + +
    +
    +

    Properties

    +
    + +
    AT_TARGET: 2
    +
    + +
    BUBBLING_PHASE: 3
    +
    + +
    CAPTURING_PHASE: 1
    +
    + +
    NONE: 0
    +
    + +
    bubbles: boolean
    +

    Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.

    +

    MDN Reference

    +
    +
    +
    + +
    cancelBubble: boolean
    +
    +

    Deprecated

    MDN Reference

    +
    +
    + +
    cancelable: boolean
    +

    Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.

    +

    MDN Reference

    +
    +
    +
    + +
    composed: boolean
    +

    Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.

    +

    MDN Reference

    +
    +
    +
    + +
    constructorParams: IArguments
    +
    + +
    currentTarget: null | EventTarget
    +

    Returns the object whose event listener's callback is currently being invoked.

    +

    MDN Reference

    +
    +
    +
    + +
    defaultPrevented: boolean
    +

    Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.

    +

    MDN Reference

    +
    +
    +
    + +
    detail: Error
    +
    + +
    eventPhase: number
    +

    Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.

    +

    MDN Reference

    +
    +
    +
    + +
    isTrusted: boolean
    +

    Returns true if event was dispatched by the user agent, and false otherwise.

    +

    MDN Reference

    +
    +
    +
    + +
    returnValue: boolean
    +
    +

    Deprecated

    MDN Reference

    +
    +
    + +
    srcElement: null | EventTarget
    +
    +

    Deprecated

    MDN Reference

    +
    +
    + +
    target: null | EventTarget
    +

    Returns the object to which event is dispatched (its target).

    +

    MDN Reference

    +
    +
    +
    + +
    timeStamp: number
    +

    Returns the event's timestamp as the number of milliseconds measured relative to the time origin.

    +

    MDN Reference

    +
    +
    +
    + +
    type: string
    +

    Returns the type of event, e.g. "click", "hashchange", or "submit".

    +

    MDN Reference

    +
    +
    +
    + +
    AT_TARGET: 2
    +
    + +
    BUBBLING_PHASE: 3
    +
    + +
    CAPTURING_PHASE: 1
    +
    + +
    NONE: 0
    +
    +

    Methods

    +
    + +
      + +
    • +

      Events cannot be re-dispatched. This was probably to prevent infinite +loops. So instead of re-dispatching the same instance, we re-dispatch +a clone of the instance.

      +
      +

      Returns EventQUICClientErrorSend

      +
    +
    + +
      + +
    • +

      Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.

      +

      MDN Reference

      +
      +

      Returns EventTarget[]

      +
    +
    + +
      + +
    • +
      +

      Parameters

      +
        +
      • +
        type: string
      • +
      • +
        Optional bubbles: boolean
      • +
      • +
        Optional cancelable: boolean
      +

      Returns void

      +
      +

      Deprecated

      MDN Reference

      +
    +
    + +
      + +
    • +

      If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.

      +

      MDN Reference

      +
      +

      Returns void

      +
    +
    + +
      + +
    • +

      Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.

      +

      MDN Reference

      +
      +

      Returns void

      +
    +
    + +
      + +
    • +

      When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.

      +

      MDN Reference

      +
      +

      Returns void

      +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file diff --git a/docs/classes/events.EventQUICConnection.html b/docs/classes/events.EventQUICConnection.html index e0dbc09e..e77e90d4 100644 --- a/docs/classes/events.EventQUICConnection.html +++ b/docs/classes/events.EventQUICConnection.html @@ -37,7 +37,7 @@

    Hierarchy

  • EventQUICConnectionStream
  • EventQUICConnectionSend
  • +
  • Defined in src/events.ts:98
  • @@ -466,6 +466,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICConnectionClose.html b/docs/classes/events.EventQUICConnectionClose.html index 7d625004..e4628a20 100644 --- a/docs/classes/events.EventQUICConnectionClose.html +++ b/docs/classes/events.EventQUICConnectionClose.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICConnectionClose
    +
  • Defined in src/events.ts:122
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICConnectionError.html b/docs/classes/events.EventQUICConnectionError.html index 27e62cc4..a6f447ff 100644 --- a/docs/classes/events.EventQUICConnectionError.html +++ b/docs/classes/events.EventQUICConnectionError.html @@ -19,7 +19,7 @@

    Class EventQUICConnectionError

    Closing a quic connection is always an error no matter if it is graceful or not. This is due to the utilisation of the error code and reason during -connection close. Additionally it is also possible that that the QUIC +connection close. Additionally, it is also possible that the QUIC connection times out. In this case, quiche does will not send a CONNECTION_CLOSE frame.

    @@ -31,7 +31,7 @@

    Hierarchy

    • EventQUICConnectionError
    +
  • Defined in src/events.ts:115
  • @@ -450,6 +450,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICConnectionSend.html b/docs/classes/events.EventQUICConnectionSend.html index 0c2fda5e..9e4f086f 100644 --- a/docs/classes/events.EventQUICConnectionSend.html +++ b/docs/classes/events.EventQUICConnectionSend.html @@ -19,11 +19,11 @@

    Class EventQUICConnectionSend

    Hierarchy

      -
    • EventQUICConnection<{
          address: string;
          msg: Uint8Array;
          port: number;
      }> +
    • EventQUICConnection<{
          address: string;
          id: string;
          msg: Uint8Array;
          port: number;
      }>
      • EventQUICConnectionSend
    +
  • Defined in src/events.ts:130
  • @@ -81,7 +81,7 @@

    Parameters

  • Optional type: string
  • -
    Optional options: CustomEventInit<{
        address: string;
        msg: Uint8Array;
        port: number;
    }>
  • +
    Optional options: CustomEventInit<{
        address: string;
        id: string;
        msg: Uint8Array;
        port: number;
    }>
  • Optional constructorParams: IArguments
  • Returns EventQUICConnectionSend

    -
    detail: {
        address: string;
        msg: Uint8Array;
        port: number;
    }
    +
    detail: {
        address: string;
        id: string;
        msg: Uint8Array;
        port: number;
    }

    Type declaration

    • address: string
    • +
      id: string
    • +
    • msg: Uint8Array
    • port: number
    +
  • Defined in src/events.ts:100
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICConnectionStarted.html b/docs/classes/events.EventQUICConnectionStarted.html index 677ac323..303b26f3 100644 --- a/docs/classes/events.EventQUICConnectionStarted.html +++ b/docs/classes/events.EventQUICConnectionStarted.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICConnectionStarted
    +
  • Defined in src/events.ts:102
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICConnectionStop.html b/docs/classes/events.EventQUICConnectionStop.html index 46c51b58..356d733d 100644 --- a/docs/classes/events.EventQUICConnectionStop.html +++ b/docs/classes/events.EventQUICConnectionStop.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICConnectionStop
    +
  • Defined in src/events.ts:104
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICConnectionStopped.html b/docs/classes/events.EventQUICConnectionStopped.html index 5f4bd6d7..ea213653 100644 --- a/docs/classes/events.EventQUICConnectionStopped.html +++ b/docs/classes/events.EventQUICConnectionStopped.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICConnectionStopped
    +
  • Defined in src/events.ts:106
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICConnectionStream.html b/docs/classes/events.EventQUICConnectionStream.html index b1269ddc..b73f7b60 100644 --- a/docs/classes/events.EventQUICConnectionStream.html +++ b/docs/classes/events.EventQUICConnectionStream.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICConnectionStream
    +
  • Defined in src/events.ts:128
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICServer.html b/docs/classes/events.EventQUICServer.html index 90647c99..7e1a0161 100644 --- a/docs/classes/events.EventQUICServer.html +++ b/docs/classes/events.EventQUICServer.html @@ -36,7 +36,7 @@

    Hierarchy

  • EventQUICServerClose
  • EventQUICServerConnection
  • +
  • Defined in src/events.ts:76
  • @@ -465,6 +465,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICServerClose.html b/docs/classes/events.EventQUICServerClose.html index 0eb8e09b..9a9b0994 100644 --- a/docs/classes/events.EventQUICServerClose.html +++ b/docs/classes/events.EventQUICServerClose.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICServerClose
    +
  • Defined in src/events.ts:92
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICServerConnection.html b/docs/classes/events.EventQUICServerConnection.html index ecbda35d..cbf25b12 100644 --- a/docs/classes/events.EventQUICServerConnection.html +++ b/docs/classes/events.EventQUICServerConnection.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICServerConnection
    +
  • Defined in src/events.ts:78
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICServerError.html b/docs/classes/events.EventQUICServerError.html index c37f64e1..3def2e4f 100644 --- a/docs/classes/events.EventQUICServerError.html +++ b/docs/classes/events.EventQUICServerError.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICServerError
    +
  • Defined in src/events.ts:88
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICServerStart.html b/docs/classes/events.EventQUICServerStart.html index 37f7f1b0..baede16a 100644 --- a/docs/classes/events.EventQUICServerStart.html +++ b/docs/classes/events.EventQUICServerStart.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICServerStart
    +
  • Defined in src/events.ts:80
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICServerStarted.html b/docs/classes/events.EventQUICServerStarted.html index 18fcb4be..f1c459e9 100644 --- a/docs/classes/events.EventQUICServerStarted.html +++ b/docs/classes/events.EventQUICServerStarted.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICServerStarted
    +
  • Defined in src/events.ts:82
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICServerStop.html b/docs/classes/events.EventQUICServerStop.html index 8364e079..687d4dd3 100644 --- a/docs/classes/events.EventQUICServerStop.html +++ b/docs/classes/events.EventQUICServerStop.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICServerStop
    +
  • Defined in src/events.ts:84
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICServerStopped.html b/docs/classes/events.EventQUICServerStopped.html index 083e3efb..5a1f2380 100644 --- a/docs/classes/events.EventQUICServerStopped.html +++ b/docs/classes/events.EventQUICServerStopped.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICServerStopped
    +
  • Defined in src/events.ts:86
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICSocket.html b/docs/classes/events.EventQUICSocket.html index 2126c197..f4948616 100644 --- a/docs/classes/events.EventQUICSocket.html +++ b/docs/classes/events.EventQUICSocket.html @@ -33,7 +33,8 @@

    Hierarchy

  • EventQUICSocketStop
  • EventQUICSocketStopped
  • EventQUICSocketError
  • -
  • EventQUICSocketClose
  • @@ -464,6 +465,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICSocketClose.html b/docs/classes/events.EventQUICSocketClose.html index b527e80d..13cdfe6a 100644 --- a/docs/classes/events.EventQUICSocketClose.html +++ b/docs/classes/events.EventQUICSocketClose.html @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICSocketError.html b/docs/classes/events.EventQUICSocketError.html index 0f290cfc..5115116e 100644 --- a/docs/classes/events.EventQUICSocketError.html +++ b/docs/classes/events.EventQUICSocketError.html @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICSocketStart.html b/docs/classes/events.EventQUICSocketStart.html index 58069cae..9e7ed069 100644 --- a/docs/classes/events.EventQUICSocketStart.html +++ b/docs/classes/events.EventQUICSocketStart.html @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICSocketStarted.html b/docs/classes/events.EventQUICSocketStarted.html index e90ee169..d3807366 100644 --- a/docs/classes/events.EventQUICSocketStarted.html +++ b/docs/classes/events.EventQUICSocketStarted.html @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICSocketStop.html b/docs/classes/events.EventQUICSocketStop.html index f7601222..2ccc07d0 100644 --- a/docs/classes/events.EventQUICSocketStop.html +++ b/docs/classes/events.EventQUICSocketStop.html @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICSocketStopped.html b/docs/classes/events.EventQUICSocketStopped.html index 223a4ad1..a210290e 100644 --- a/docs/classes/events.EventQUICSocketStopped.html +++ b/docs/classes/events.EventQUICSocketStopped.html @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICStream.html b/docs/classes/events.EventQUICStream.html index cba949e2..23e22a74 100644 --- a/docs/classes/events.EventQUICStream.html +++ b/docs/classes/events.EventQUICStream.html @@ -35,7 +35,7 @@

    Hierarchy

  • EventQUICStreamCloseWrite
  • EventQUICStreamSend
  • +
  • Defined in src/events.ts:139
  • @@ -464,6 +464,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICStreamCloseRead.html b/docs/classes/events.EventQUICStreamCloseRead.html index 7dfe5de6..e1be7e8b 100644 --- a/docs/classes/events.EventQUICStreamCloseRead.html +++ b/docs/classes/events.EventQUICStreamCloseRead.html @@ -31,7 +31,7 @@

    Hierarchy

    • EventQUICStreamCloseRead
    +
  • Defined in src/events.ts:164
  • @@ -450,6 +450,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICStreamCloseWrite.html b/docs/classes/events.EventQUICStreamCloseWrite.html index e3e6bb8d..aeb3d1e5 100644 --- a/docs/classes/events.EventQUICStreamCloseWrite.html +++ b/docs/classes/events.EventQUICStreamCloseWrite.html @@ -31,7 +31,7 @@

    Hierarchy

    • EventQUICStreamCloseWrite
    +
  • Defined in src/events.ts:178
  • @@ -450,6 +450,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICStreamDestroy.html b/docs/classes/events.EventQUICStreamDestroy.html index f1d321a3..d84197ac 100644 --- a/docs/classes/events.EventQUICStreamDestroy.html +++ b/docs/classes/events.EventQUICStreamDestroy.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICStreamDestroy
    +
  • Defined in src/events.ts:141
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICStreamDestroyed.html b/docs/classes/events.EventQUICStreamDestroyed.html index a58405e0..bec14bc3 100644 --- a/docs/classes/events.EventQUICStreamDestroyed.html +++ b/docs/classes/events.EventQUICStreamDestroyed.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICStreamDestroyed
    +
  • Defined in src/events.ts:143
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICStreamError.html b/docs/classes/events.EventQUICStreamError.html index ee20b184..53cdee96 100644 --- a/docs/classes/events.EventQUICStreamError.html +++ b/docs/classes/events.EventQUICStreamError.html @@ -27,7 +27,7 @@

    Hierarchy

    • EventQUICStreamError
    +
  • Defined in src/events.ts:148
  • @@ -446,6 +446,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/classes/events.EventQUICStreamSend.html b/docs/classes/events.EventQUICStreamSend.html index 488a0523..f2930ad1 100644 --- a/docs/classes/events.EventQUICStreamSend.html +++ b/docs/classes/events.EventQUICStreamSend.html @@ -23,7 +23,7 @@

    Hierarchy

    • EventQUICStreamSend
    +
  • Defined in src/events.ts:184
  • @@ -442,6 +442,7 @@

    EventQUICClientDestroy
  • EventQUICClientDestroyed
  • EventQUICClientError
  • +
  • EventQUICClientErrorSend
  • EventQUICConnection
  • EventQUICConnectionClose
  • EventQUICConnectionError
  • diff --git a/docs/functions/utils.bufferWrap.html b/docs/functions/utils.bufferWrap.html index 62b29525..142b01dc 100644 --- a/docs/functions/utils.bufferWrap.html +++ b/docs/functions/utils.bufferWrap.html @@ -35,7 +35,7 @@

    Optional Returns Buffer
    +
  • Defined in src/utils.ts:86
  • +
  • validateToken
  • +
  • yieldMicro
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.collectPEMs.html b/docs/functions/utils.collectPEMs.html index 96aa206e..dc7496a6 100644 --- a/docs/functions/utils.collectPEMs.html +++ b/docs/functions/utils.collectPEMs.html @@ -27,11 +27,11 @@

    Function collectPEMs

    Parameters

    • -
      Optional pems: string | string[] | Uint8Array | Uint8Array[]
    +
    Optional pems: string | Uint8Array | string[] | Uint8Array[]

    Returns string[]

    +
  • Defined in src/utils.ts:398
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.derToPEM.html b/docs/functions/utils.derToPEM.html index 833208ac..9ef723a0 100644 --- a/docs/functions/utils.derToPEM.html +++ b/docs/functions/utils.derToPEM.html @@ -30,7 +30,7 @@
    der: Returns string
    +
  • Defined in src/utils.ts:433
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.formatError.html b/docs/functions/utils.formatError.html index 255120c6..b467a990 100644 --- a/docs/functions/utils.formatError.html +++ b/docs/functions/utils.formatError.html @@ -31,7 +31,7 @@
    error: Returns string
    +
  • Defined in src/utils.ts:447
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.isHostWildcard.html b/docs/functions/utils.isHostWildcard.html index 08ce7139..303697ba 100644 --- a/docs/functions/utils.isHostWildcard.html +++ b/docs/functions/utils.isHostWildcard.html @@ -27,7 +27,7 @@

    Parameters

    host: Host

    Returns boolean

    +
  • Defined in src/utils.ts:216
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.isIPv4MappedIPv6.html b/docs/functions/utils.isIPv4MappedIPv6.html index 87dd9967..d10a2172 100644 --- a/docs/functions/utils.isIPv4MappedIPv6.html +++ b/docs/functions/utils.isIPv4MappedIPv6.html @@ -35,7 +35,7 @@
    host: Returns host is Host
    +
  • Defined in src/utils.ts:131
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.isIPv4MappedIPv6Hex.html b/docs/functions/utils.isIPv4MappedIPv6Hex.html index c32a52e7..57b16887 100644 --- a/docs/functions/utils.isIPv4MappedIPv6Hex.html +++ b/docs/functions/utils.isIPv4MappedIPv6Hex.html @@ -27,7 +27,7 @@

    Parameters

    host: string

    Returns host is Host

    +
  • Defined in src/utils.ts:148
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.isPort.html b/docs/functions/utils.isPort.html index 9d67d36c..fdfe64d7 100644 --- a/docs/functions/utils.isPort.html +++ b/docs/functions/utils.isPort.html @@ -30,7 +30,7 @@
    port: Returns port is Port
    +
  • Defined in src/utils.ts:302
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.isStreamClientInitiated.html b/docs/functions/utils.isStreamClientInitiated.html index 5175f8ec..cad25a2a 100644 --- a/docs/functions/utils.isStreamClientInitiated.html +++ b/docs/functions/utils.isStreamClientInitiated.html @@ -27,7 +27,7 @@

    Parameters

    streamId: StreamId

    Returns boolean

    +
  • Defined in src/utils.ts:518
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.isStreamServerInitiated.html b/docs/functions/utils.isStreamServerInitiated.html index d23f7f6e..70d3f519 100644 --- a/docs/functions/utils.isStreamServerInitiated.html +++ b/docs/functions/utils.isStreamServerInitiated.html @@ -27,7 +27,7 @@

    Parameters

    streamId: StreamId

    Returns boolean

    +
  • Defined in src/utils.ts:522
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.isStreamUnidirectional.html b/docs/functions/utils.isStreamUnidirectional.html index 153d137d..5cf55fdd 100644 --- a/docs/functions/utils.isStreamUnidirectional.html +++ b/docs/functions/utils.isStreamUnidirectional.html @@ -27,7 +27,7 @@

    Parameters

    streamId: StreamId

    Returns boolean

    +
  • Defined in src/utils.ts:526
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.never.html b/docs/functions/utils.never.html new file mode 100644 index 00000000..84c87256 --- /dev/null +++ b/docs/functions/utils.never.html @@ -0,0 +1,129 @@ +never | @matrixai/quic
    +
    + +
    + +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file diff --git a/docs/functions/utils.pemToDER.html b/docs/functions/utils.pemToDER.html index 520cebcc..f35a45b8 100644 --- a/docs/functions/utils.pemToDER.html +++ b/docs/functions/utils.pemToDER.html @@ -30,7 +30,7 @@
    pem: Returns Uint8Array
    +
  • Defined in src/utils.ts:421
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.promisify.html b/docs/functions/utils.promisify.html index 015f9566..6d25aa32 100644 --- a/docs/functions/utils.promisify.html +++ b/docs/functions/utils.promisify.html @@ -63,7 +63,7 @@
    Rest Returns Promise<R>
    +
  • Defined in src/utils.ts:37
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.resolveHostname.html b/docs/functions/utils.resolveHostname.html index 4c0c38e4..278e29b1 100644 --- a/docs/functions/utils.resolveHostname.html +++ b/docs/functions/utils.resolveHostname.html @@ -32,7 +32,7 @@
    hostname: Returns Promise<Host>
    +
  • Defined in src/utils.ts:268
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.setMaxListeners.html b/docs/functions/utils.setMaxListeners.html new file mode 100644 index 00000000..43f26436 --- /dev/null +++ b/docs/functions/utils.setMaxListeners.html @@ -0,0 +1,142 @@ +setMaxListeners | @matrixai/quic
    +
    + +
    +
    +
    +
    + +

    Function setMaxListeners

    +
    +
      + +
    • +

      Increases the total number of registered event handlers before a node warning is emitted. +In most cases this is not needed but in the case where you have one event emitter for multiple handlers you'll need +to increase the limit.

      +
      +
      +

      Parameters

      +
        +
      • +
        target: EventEmitter | EventTarget
        +

        The specific EventTarget or EventEmitter to increase the warning for.

        +
        +
      • +
      • +
        limit: number = 100000
        +

        The limit before the warning is emitted, defaults to 100000.

        +
        +
      +

      Returns void

      +
    +
    +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file diff --git a/docs/functions/utils.toCanonicalIP.html b/docs/functions/utils.toCanonicalIP.html index c3a2839a..0b7d8ed6 100644 --- a/docs/functions/utils.toCanonicalIP.html +++ b/docs/functions/utils.toCanonicalIP.html @@ -31,7 +31,7 @@
    host: Returns Host
    +
  • Defined in src/utils.ts:230
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.toIPv4MappedIPv6Hex.html b/docs/functions/utils.toIPv4MappedIPv6Hex.html index 69bc8df3..384f5f5c 100644 --- a/docs/functions/utils.toIPv4MappedIPv6Hex.html +++ b/docs/functions/utils.toIPv4MappedIPv6Hex.html @@ -31,7 +31,7 @@
    host: Returns Host
    +
  • Defined in src/utils.ts:187
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.validateTarget.html b/docs/functions/utils.validateTarget.html index 54123d05..abe1be5e 100644 --- a/docs/functions/utils.validateTarget.html +++ b/docs/functions/utils.validateTarget.html @@ -35,7 +35,7 @@
    targetUdpType: errorClass: Class<Error>

    Returns Host

    +
  • Defined in src/utils.ts:330
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/functions/utils.yieldMicro.html b/docs/functions/utils.yieldMicro.html new file mode 100644 index 00000000..b9fbb6a4 --- /dev/null +++ b/docs/functions/utils.yieldMicro.html @@ -0,0 +1,127 @@ +yieldMicro | @matrixai/quic
    +
    + +
    + +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 93cb11e7..71f2920c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,19 +12,22 @@

    @matrixai/quic

    -

    js-quic

    staging: pipeline status -master: pipeline status

    -

    QUIC library for TypeScript/JavaScript applications.

    +

    js-quic

    QUIC library for TypeScript/JavaScript applications.

    This is built on top of Cloudflare's quiche library. It is intended to support Linux, Windows MacOS, Android and iOS. Mobile support is still pending.

    Since Cloudflare's quiche is written in Rust. This uses the napi-rs binding system compile the native objects for Node.js.

    This library focuses only on the QUIC protocol. It does not support HTTP3. You can build HTTP3 on top of this.

    Installation

    npm install --save @matrixai/quic
     
    -

    Usage

    See the example executables in /src/bin.

    -

    Development

    Run nix-shell, and once you're inside, you can use:

    -
    # install (or reinstall packages from package.json)
    npm install
    # build the native objects
    npm run prebuild
    # build the dist and native objects
    npm run build
    # run the repl (this allows you to import from ./src)
    npm run ts-node
    # run the tests
    npm run test
    # lint the source code
    npm run lint
    # automatically fix the source
    npm run lintfix +

    Usage

    See the example usage in tests.

    +

    Development

    Run nix develop, and once you're inside, you can use:

    +
    # install (or reinstall packages from package.json)
    npm install
    # build the native objects
    npm run prebuild
    # build the dist and native objects
    npm run build
    # run the repl (this allows you to import from ./src)
    npm run tsx
    # run the tests
    npm run test
    # lint the source code
    npm run lint
    # automatically fix the source
    npm run lintfix
    -

    Quiche

    To understand how to develop this, it is important to understand how quiche works.

    +

    Docs Generation

    npm run docs
    +
    +

    See the docs at: https://matrixai.github.io/js-quic/

    +

    Publishing

    # npm login
    npm version patch # major/minor/patch
    npm run build
    npm publish --access public
    git push
    git push --tags +
    +

    How it works

    Quiche

    To understand how to develop this, it is important to understand how quiche works.

    Clone the https://github.com/cloudflare/quiche project. It's multi-workspace Cargo project.

    You can build and run their examples located in /quiche/examples/:

    cargo build --examples
    cargo run --example client '127.0.0.1:55555' @@ -45,18 +48,18 @@

    @matrixai/quic

    Structure

    It is possible to structure the QUIC system in the encapsulated way or the injected way.

    When using the encapsulated way, the QUICSocket is separated between client and server.

    When using the injected way, the QUICSocket is shared between client and server.

    -

    +

    image

    If you are building a peer to peer network, you must use the injected way. This is the only way to ensure that hole-punching works because both the client and server for any given peer must share the same UDP socket and thus share the QUICSocket. When done in this way, the QUICSocket lifecycle is managed outside of both the QUICClient and QUICServer.

    -

    +

    image

    This also means both QUICClient and QUICServer must share the same connection map. In order to allow the QUICSocket to dispatch data into the correct connection, the connection map is constructed in the QUICSocket, however setting and unsetting connections is managed by QUICClient and QUICServer.

    -

    Dataflow

    The data flow of the QUIC system is a bidirectional graph.

    +

    Dataflow

    The data flow of the QUIC system is a bidirectional graph.

    Data received from the outside world is received on the UDP socket. It is parsed and then dispatched to each QUICConnection. Each connection further parses the data and then dispatches to the QUICStream. Each QUICStream presents the data on the ReadableStream interface, which can be read by a caller.

    Data sent to the outside world is written to a WritableStream interface of a QUICStream. This data is buffered up in the underlying Quiche stream. A send procedure is triggered on the associated QUICConnection which takes all the buffered data to be sent for that connection, and sends it to the QUICSocket, which then sends it to the underlying UDP socket.

    -

    +

    image

    Buffering occurs at the connection level and at the stream level. Each connection has a global buffer for all streams, and each stream has its own buffer. Note that connection buffering and stream buffering all occur within the Quiche library. The web streams ReadableStream and WritableStream do not do any buffering at all.

    Connection Negotiation

    The connection negotiation process involves several exchanges of QUIC packets before the QUICConnection is constructed.

    The primary reason to do this is for both sides to determine their respective connection IDs.

    -

    +

    image

    Push & Pull

    The QUICSocket, QUICClient, QUICServer, QUICConnection and QUICStream are independent state machines that exposes methods that can be called as well as events that may be emitted between them.

    This creates a concurrent decentralised state machine system where there are multiple entrypoints of change.

    Users may call methods which causes state transitions internally that trigger event emissions. However some methods are considered internal to the library, this means these methods are not intended to be called by the end user. They are however public relative to the other components in the system. These methods should be marked with @internal documentation annotation.

    @@ -66,22 +69,7 @@

    @matrixai/quic

  • Pull methods - these are either synchronous or asynchronous methods that may throw exceptions.
  • Push handlers - these are event handlers that can initiate pull methods, if these pull handlers throw exceptions, these exceptions must be caught, and expected runtime exceptions are to be converted to error events, all other exceptions will be considered to be software bugs and will be bubbled up to the program boundary as unhandled exceptions or unhandled promise rejections. Generally the only exceptions that are expected runtime exceptions are those that arise from perform IO with the operating system.
  • -

    Benchmarks

    npm run bench
    -
    -

    View benchmarks here: https://github.com/MatrixAI/js-quic/blob/master/benches/results with https://raw.githack.com/

    -

    Docs Generation

    npm run docs
    -
    -

    See the docs at: https://matrixai.github.io/js-quic/

    -

    Publishing

    Publishing is handled automatically by the staging pipeline.

    -

    Prerelease:

    -
    # npm login
    npm version prepatch --preid alpha # premajor/preminor/prepatch
    git push --follow-tags -
    -

    Release:

    -
    # npm login
    npm version patch # major/minor/patch
    git push --follow-tags -
    -

    Manually:

    -
    # npm login
    npm version patch # major/minor/patch
    npm run build
    npm publish --access public
    git push
    git push --tags -
    +

    License

    js-quic is licensed under Apache-2.0, you may read the terms of the license here.

    +
  • License
  • Returns number

    +
  • Defined in src/native/quiche.ts:37
    • @@ -175,7 +175,7 @@
      version: out: Uint8Array

    Returns number

    +
  • Defined in src/native/quiche.ts:42
    • @@ -188,7 +188,7 @@

      Parameters

      version: number

    Returns boolean

    +
  • Defined in src/native/quiche.ts:50
  • +
  • ErrorQUICStreamPeerWrite
  • +
  • ErrorQUICUndefinedBehaviour
  • events
  • native
  • utils
  • diff --git a/docs/modules/events.html b/docs/modules/events.html index 2c99845c..6a8b825f 100644 --- a/docs/modules/events.html +++ b/docs/modules/events.html @@ -28,6 +28,7 @@

    Classes

    EventQUICClientDestroy EventQUICClientDestroyed EventQUICClientError +EventQUICClientErrorSend EventQUICConnection EventQUICConnectionClose EventQUICConnectionError @@ -89,6 +90,7 @@

    Theme

    +
  • validateToken
  • +
  • yieldMicro
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • diff --git a/docs/types/ConnectionId.html b/docs/types/ConnectionId.html index c680d1f6..71355b83 100644 --- a/docs/types/ConnectionId.html +++ b/docs/types/ConnectionId.html @@ -17,7 +17,7 @@

    Type alias ConnectionId

    ConnectionId: Opaque<"ConnectionId", Buffer>
    +
  • Defined in src/types.ts:323
  • +
  • Defined in src/types.ts:325
  • +
  • Defined in src/types.ts:327
  • +
  • Defined in src/types.ts:316
  • +
  • Defined in src/types.ts:318
  • +
  • Defined in src/types.ts:350
  • +
  • Defined in src/types.ts:348
  • +
  • Defined in src/types.ts:337
  • +
  • Defined in src/types.ts:343
  • +
  • Defined in src/native/quiche.ts:89
  • +
  • Defined in src/utils.ts:19
  • QUICClient
  • QUICConnection
  • QUICConnectionId
  • From 212065fd1c367ab425aed3a262ee25fe198a3bb8 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Mon, 24 Mar 2025 12:43:53 +1100 Subject: [PATCH 04/23] fix: fixing scripts [ci skip] --- package.json | 4 ++-- .../{prepublishOnly.js => prepublishOnly.mjs} | 22 +++++++++++-------- scripts/{version.js => version.mjs} | 20 ++++++++++------- 3 files changed, 27 insertions(+), 19 deletions(-) rename scripts/{prepublishOnly.js => prepublishOnly.mjs} (90%) rename scripts/{version.js => version.mjs} (87%) diff --git a/package.json b/package.json index 27c90d9e..1f756492 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,8 @@ "prepare": "tsc -p ./tsconfig.build.json", "prebuild": "node ./scripts/prebuild.mjs", "build": "shx rm -rf ./dist && tsc -p ./tsconfig.build.json", - "version": "node ./scripts/version.js", - "prepublishOnly": "node ./scripts/prepublishOnly.js", + "version": "node ./scripts/version.mjs", + "prepublishOnly": "node ./scripts/prepublishOnly.mjs", "tsx": "tsx", "test": "node ./scripts/test.mjs", "lint": "eslint '{src,tests,scripts,benches}/**/*.{js,mjs,ts,mts,jsx,tsx}'", diff --git a/scripts/prepublishOnly.js b/scripts/prepublishOnly.mjs similarity index 90% rename from scripts/prepublishOnly.js rename to scripts/prepublishOnly.mjs index 9bb6545a..6bea4fa5 100755 --- a/scripts/prepublishOnly.js +++ b/scripts/prepublishOnly.mjs @@ -15,15 +15,20 @@ * /README.md */ -const os = require('os'); -const fs = require('fs'); -const path = require('path'); -const process = require('process'); -const childProcess = require('child_process'); -const packageJSON = require('../package.json'); +import os from 'node:os'; +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; +import childProcess from 'node:child_process'; +import url from 'node:url'; +import packageJSON from '../package.json' assert { type: 'json' }; const platform = os.platform(); +const projectPath = path.dirname( + path.dirname(url.fileURLToPath(import.meta.url)), +); + /* eslint-disable no-console */ async function main(argv = process.argv) { argv = argv.slice(2); @@ -44,9 +49,8 @@ async function main(argv = process.argv) { if (tag == null) { tag = process.env.npm_config_tag; } - const projectRoot = path.join(__dirname, '..'); - const prebuildPath = path.join(projectRoot, 'prebuild'); - const prepublishOnlyPath = path.join(projectRoot, 'prepublishOnly'); + const prebuildPath = path.join(projectPath, 'prebuild'); + const prepublishOnlyPath = path.join(projectPath, 'prepublishOnly'); const buildNames = (await fs.promises.readdir(prebuildPath)).filter( (filename) => /^(?:[^-]+)-(?:[^-]+)-(?:[^-]+)$/.test(filename), ); diff --git a/scripts/version.js b/scripts/version.mjs similarity index 87% rename from scripts/version.js rename to scripts/version.mjs index 9f4602cd..b1d26d1d 100755 --- a/scripts/version.js +++ b/scripts/version.mjs @@ -13,19 +13,23 @@ * to prevent `npm` from attempting to download unpublished packages. */ -const path = require('path'); -const fs = require('fs'); -const os = require('os'); -const childProcess = require('child_process'); -const packageJSON = require('../package.json'); +import path from 'node:path'; +import fs from 'node:fs'; +import os from 'node:os'; +import url from 'node:url'; +import childProcess from 'node:child_process'; +import packageJSON from '../package.json' assert { type: 'json' }; const platform = os.platform(); +const projectPath = path.dirname( + path.dirname(url.fileURLToPath(import.meta.url)), +); + /* eslint-disable no-console */ async function main() { - const projectRoot = path.join(__dirname, '..'); - const cargoTOMLPath = path.join(projectRoot, 'Cargo.toml'); - const cargoLockPath = path.join(projectRoot, 'Cargo.lock'); + const cargoTOMLPath = path.join(projectPath, 'Cargo.toml'); + const cargoLockPath = path.join(projectPath, 'Cargo.lock'); console.error('Updating the Cargo.toml version to match new version'); const cargoTOML = await fs.promises.readFile(cargoTOMLPath, 'utf-8'); From c0d522c82a7587d00006a70798f0acae299cd813 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Mon, 24 Mar 2025 12:53:27 +1100 Subject: [PATCH 05/23] 2.0.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 75 +++++------------------------------------------ package.json | 12 ++++---- 4 files changed, 15 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52957cf4..b7a79da4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "quic" -version = "1.3.13" +version = "2.0.0" dependencies = [ "boring", "napi", diff --git a/Cargo.toml b/Cargo.toml index f736dc1b..0127f77a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quic" -version = "1.3.13" +version = "2.0.0" authors = ["Roger Qiu "] license-file = "LICENSE" edition = "2021" diff --git a/package-lock.json b/package-lock.json index f6356604..038314d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/quic", - "version": "1.3.13", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/quic", - "version": "1.3.13", + "version": "2.0.0", "license": "Apache-2.0", "dependencies": { "@matrixai/async-cancellable": "^2.0.1", @@ -56,11 +56,11 @@ "typescript": "^5.1.6" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "1.3.13", - "@matrixai/quic-darwin-universal": "1.3.13", - "@matrixai/quic-darwin-x64": "1.3.13", - "@matrixai/quic-linux-x64": "1.3.13", - "@matrixai/quic-win32-x64": "1.3.13" + "@matrixai/quic-darwin-arm64": "2.0.0", + "@matrixai/quic-darwin-universal": "2.0.0", + "@matrixai/quic-darwin-x64": "2.0.0", + "@matrixai/quic-linux-x64": "2.0.0", + "@matrixai/quic-win32-x64": "2.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1820,67 +1820,6 @@ "resolved": "https://registry.npmjs.org/@matrixai/logger/-/logger-4.0.3.tgz", "integrity": "sha512-cu7e82iwN32H+K8HxsrvrWEYSEj7+RP/iVFhJ4RuacC8/BSOLFOYxry3EchVjrx4FP5G7QP1HnKYXAGpZN/46w==" }, - "node_modules/@matrixai/quic-darwin-arm64": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@matrixai/quic-darwin-arm64/-/quic-darwin-arm64-1.3.13.tgz", - "integrity": "sha512-cnosZctgd6W8KaTHMnxiy/0eWmLjN7ciuOLzmYooZeOCXKGCTxyKpHYBXylSKvL1i8Jm0725tk9InbEegViJmw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@matrixai/quic-darwin-universal": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@matrixai/quic-darwin-universal/-/quic-darwin-universal-1.3.13.tgz", - "integrity": "sha512-pnoPZFD2FPrtPKa7mvho6c1YKKXBeIT5KlJ4QNMfx3UKh8XZCYGXWSJs8NlhAl6VdzN/3ik9glIGxTPLHtJjSQ==", - "cpu": [ - "x64", - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@matrixai/quic-darwin-x64": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@matrixai/quic-darwin-x64/-/quic-darwin-x64-1.3.13.tgz", - "integrity": "sha512-wsLmrr98Ae4104LTlx/Tgt5WN4rs0uzUpYFlvAiW2KmoS5tVEXm8eBwUj2HHp6xmuKrlT5ERU06HFhZFsGmXuA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@matrixai/quic-linux-x64": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@matrixai/quic-linux-x64/-/quic-linux-x64-1.3.13.tgz", - "integrity": "sha512-dCMnMQf8t0qy7no3vyuETw9abKUtia7UGN0sGAZygjscYWRXtLMuoNyiHNSTaORP0pVIYl3rPDD39BuevcqtrA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@matrixai/quic-win32-x64": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@matrixai/quic-win32-x64/-/quic-win32-x64-1.3.13.tgz", - "integrity": "sha512-mmDv7B0kkF2E64DnZ2OXLYDCbWy148uG7cgtgyf+d7iWbCrx90uX4vSsyUTbg74/xjPKxX+tJOJFRnEeMlfV6w==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@matrixai/resources": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@matrixai/resources/-/resources-2.0.1.tgz", diff --git a/package.json b/package.json index 1f756492..673e5b8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/quic", - "version": "1.3.13", + "version": "2.0.0", "author": "Matrix AI", "contributors": [ { @@ -62,11 +62,11 @@ "ip-num": "^1.5.0" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "1.3.13", - "@matrixai/quic-darwin-universal": "1.3.13", - "@matrixai/quic-darwin-x64": "1.3.13", - "@matrixai/quic-linux-x64": "1.3.13", - "@matrixai/quic-win32-x64": "1.3.13" + "@matrixai/quic-darwin-arm64": "2.0.0", + "@matrixai/quic-darwin-universal": "2.0.0", + "@matrixai/quic-darwin-x64": "2.0.0", + "@matrixai/quic-linux-x64": "2.0.0", + "@matrixai/quic-win32-x64": "2.0.0" }, "devDependencies": { "@fast-check/jest": "^2.1.0", From 67bc3d53cbc591276388cfa3c733bb18bf2243d8 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 07:44:07 +1100 Subject: [PATCH 06/23] test: increasing stack trace for benches --- benches/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/benches/index.ts b/benches/index.ts index 6e870210..a15bff74 100644 --- a/benches/index.ts +++ b/benches/index.ts @@ -7,6 +7,9 @@ import url from 'node:url'; import si from 'systeminformation'; import { fsWalk, resultsPath, suitesPath } from './utils.js'; +// Adding for more context +Error.stackTraceLimit = 100; + const dirname = url.fileURLToPath(new URL('.', import.meta.url)); async function main(): Promise { From 9271798323afc2f2e8babcdee1415310fd9f16ee Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 07:44:24 +1100 Subject: [PATCH 07/23] 2.0.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 14 +++++++------- package.json | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7a79da4..4220696a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "quic" -version = "2.0.0" +version = "2.0.1" dependencies = [ "boring", "napi", diff --git a/Cargo.toml b/Cargo.toml index 0127f77a..048ede7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quic" -version = "2.0.0" +version = "2.0.1" authors = ["Roger Qiu "] license-file = "LICENSE" edition = "2021" diff --git a/package-lock.json b/package-lock.json index 038314d8..394aa0af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/quic", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/quic", - "version": "2.0.0", + "version": "2.0.1", "license": "Apache-2.0", "dependencies": { "@matrixai/async-cancellable": "^2.0.1", @@ -56,11 +56,11 @@ "typescript": "^5.1.6" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.0", - "@matrixai/quic-darwin-universal": "2.0.0", - "@matrixai/quic-darwin-x64": "2.0.0", - "@matrixai/quic-linux-x64": "2.0.0", - "@matrixai/quic-win32-x64": "2.0.0" + "@matrixai/quic-darwin-arm64": "2.0.1", + "@matrixai/quic-darwin-universal": "2.0.1", + "@matrixai/quic-darwin-x64": "2.0.1", + "@matrixai/quic-linux-x64": "2.0.1", + "@matrixai/quic-win32-x64": "2.0.1" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 673e5b8f..be37a033 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/quic", - "version": "2.0.0", + "version": "2.0.1", "author": "Matrix AI", "contributors": [ { @@ -62,11 +62,11 @@ "ip-num": "^1.5.0" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.0", - "@matrixai/quic-darwin-universal": "2.0.0", - "@matrixai/quic-darwin-x64": "2.0.0", - "@matrixai/quic-linux-x64": "2.0.0", - "@matrixai/quic-win32-x64": "2.0.0" + "@matrixai/quic-darwin-arm64": "2.0.1", + "@matrixai/quic-darwin-universal": "2.0.1", + "@matrixai/quic-darwin-x64": "2.0.1", + "@matrixai/quic-linux-x64": "2.0.1", + "@matrixai/quic-win32-x64": "2.0.1" }, "devDependencies": { "@fast-check/jest": "^2.1.0", From 7db56d8e632f0a4516d63ac06ba741d7c59bd1d3 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 08:31:43 +1100 Subject: [PATCH 08/23] test: attempting fixes for both mac and win --- scripts/brew-install.sh | 6 ++---- src/native/quiche.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/brew-install.sh b/scripts/brew-install.sh index f411eb0d..3672d719 100755 --- a/scripts/brew-install.sh +++ b/scripts/brew-install.sh @@ -20,7 +20,5 @@ brew link --overwrite rustup-init # Brew does not provide specific versions of rust # However rustup provides specific versions # Here we provide both toolchains -rustup-init \ - --default-toolchain 1.68.2 \ - --target x86_64-apple-darwin aarch64-apple-darwin \ - -y +rustup-init --default-toolchain 1.68.2 -y +rustup add x86_64-apple-darwin aarch64-apple-darwin diff --git a/src/native/quiche.ts b/src/native/quiche.ts index 1c742a74..3c60abb0 100644 --- a/src/native/quiche.ts +++ b/src/native/quiche.ts @@ -70,6 +70,11 @@ function requireBinding(targets: Array): Quiche { } catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e; } + try { + return require(url.pathToFileURL(prebuildTarget).href); + } catch (e) { + if (e.code !== 'MODULE_NOT_FOUND') throw e; + } } const npmTargets = targets.map((target) => `@matrixai/quic-${target}`); for (const npmTarget of npmTargets) { @@ -78,6 +83,11 @@ function requireBinding(targets: Array): Quiche { } catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e; } + try { + return require(url.pathToFileURL(npmTarget).href); + } catch (e) { + if (e.code !== 'MODULE_NOT_FOUND') throw e; + } } throw new Error( `Failed requiring possible native bindings: ${prebuildTargets.concat( From ca9da7706cd13171f2397785a526a91e48735d9e Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 08:32:12 +1100 Subject: [PATCH 09/23] 2.0.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 14 +++++++------- package.json | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4220696a..a1f88e2f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "quic" -version = "2.0.1" +version = "2.0.2" dependencies = [ "boring", "napi", diff --git a/Cargo.toml b/Cargo.toml index 048ede7a..c35656c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quic" -version = "2.0.1" +version = "2.0.2" authors = ["Roger Qiu "] license-file = "LICENSE" edition = "2021" diff --git a/package-lock.json b/package-lock.json index 394aa0af..553caf3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/quic", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/quic", - "version": "2.0.1", + "version": "2.0.2", "license": "Apache-2.0", "dependencies": { "@matrixai/async-cancellable": "^2.0.1", @@ -56,11 +56,11 @@ "typescript": "^5.1.6" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.1", - "@matrixai/quic-darwin-universal": "2.0.1", - "@matrixai/quic-darwin-x64": "2.0.1", - "@matrixai/quic-linux-x64": "2.0.1", - "@matrixai/quic-win32-x64": "2.0.1" + "@matrixai/quic-darwin-arm64": "2.0.2", + "@matrixai/quic-darwin-universal": "2.0.2", + "@matrixai/quic-darwin-x64": "2.0.2", + "@matrixai/quic-linux-x64": "2.0.2", + "@matrixai/quic-win32-x64": "2.0.2" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index be37a033..e93f3ec2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/quic", - "version": "2.0.1", + "version": "2.0.2", "author": "Matrix AI", "contributors": [ { @@ -62,11 +62,11 @@ "ip-num": "^1.5.0" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.1", - "@matrixai/quic-darwin-universal": "2.0.1", - "@matrixai/quic-darwin-x64": "2.0.1", - "@matrixai/quic-linux-x64": "2.0.1", - "@matrixai/quic-win32-x64": "2.0.1" + "@matrixai/quic-darwin-arm64": "2.0.2", + "@matrixai/quic-darwin-universal": "2.0.2", + "@matrixai/quic-darwin-x64": "2.0.2", + "@matrixai/quic-linux-x64": "2.0.2", + "@matrixai/quic-win32-x64": "2.0.2" }, "devDependencies": { "@fast-check/jest": "^2.1.0", From 3e67ef02600606f14060cb9ec2d7bcd6186441c4 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 09:36:11 +1100 Subject: [PATCH 10/23] test: attempting fixes for both mac and win --- benches/index.ts | 6 +++--- scripts/brew-install.sh | 3 ++- src/native/quiche.ts | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/benches/index.ts b/benches/index.ts index a15bff74..5679b3ca 100644 --- a/benches/index.ts +++ b/benches/index.ts @@ -7,12 +7,11 @@ import url from 'node:url'; import si from 'systeminformation'; import { fsWalk, resultsPath, suitesPath } from './utils.js'; -// Adding for more context -Error.stackTraceLimit = 100; - const dirname = url.fileURLToPath(new URL('.', import.meta.url)); +console.log('dirname', dirname); async function main(): Promise { + console.log('mkdir', path.join(dirname, 'results')); await fs.promises.mkdir(path.join(dirname, 'results'), { recursive: true }); // Running all suites for await (const suitePath of fsWalk(suitesPath)) { @@ -49,6 +48,7 @@ async function main(): Promise { osInfo: 'platform, distro, release, kernel, arch', system: 'model, manufacturer', }); + console.log('write file', path.join(dirname, 'results', 'system.json')) await fs.promises.writeFile( path.join(dirname, 'results', 'system.json'), JSON.stringify(systemData, null, 2), diff --git a/scripts/brew-install.sh b/scripts/brew-install.sh index 3672d719..88c9b36d 100755 --- a/scripts/brew-install.sh +++ b/scripts/brew-install.sh @@ -21,4 +21,5 @@ brew link --overwrite rustup-init # However rustup provides specific versions # Here we provide both toolchains rustup-init --default-toolchain 1.68.2 -y -rustup add x86_64-apple-darwin aarch64-apple-darwin +rustup add x86_64-apple-darwin +rustup add aarch64-apple-darwin diff --git a/src/native/quiche.ts b/src/native/quiche.ts index 3c60abb0..3bb6f032 100644 --- a/src/native/quiche.ts +++ b/src/native/quiche.ts @@ -66,11 +66,13 @@ function requireBinding(targets: Array): Quiche { ); for (const prebuildTarget of prebuildTargets) { try { + console.log('trying path', prebuildTarget); return require(prebuildTarget); } catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e; } try { + console.log('trying path', url.pathToFileURL(prebuildTarget).href); return require(url.pathToFileURL(prebuildTarget).href); } catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e; @@ -79,11 +81,13 @@ function requireBinding(targets: Array): Quiche { const npmTargets = targets.map((target) => `@matrixai/quic-${target}`); for (const npmTarget of npmTargets) { try { + console.log('trying path', npmTarget); return require(npmTarget); } catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e; } try { + console.log('trying path', url.pathToFileURL(npmTarget).href); return require(url.pathToFileURL(npmTarget).href); } catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e; @@ -161,6 +165,8 @@ switch (process.platform) { ); } +console.log('dirname', dirname); + export default nativeBinding; export type { Quiche }; From a4245469d4149ae0cf52e8127cacd515680b6770 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 09:36:29 +1100 Subject: [PATCH 11/23] 2.0.3 --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 14 +++++++------- package.json | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a1f88e2f..a4c2f2ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "quic" -version = "2.0.2" +version = "2.0.3" dependencies = [ "boring", "napi", diff --git a/Cargo.toml b/Cargo.toml index c35656c0..98e3e431 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quic" -version = "2.0.2" +version = "2.0.3" authors = ["Roger Qiu "] license-file = "LICENSE" edition = "2021" diff --git a/package-lock.json b/package-lock.json index 553caf3d..43b20930 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/quic", - "version": "2.0.2", + "version": "2.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/quic", - "version": "2.0.2", + "version": "2.0.3", "license": "Apache-2.0", "dependencies": { "@matrixai/async-cancellable": "^2.0.1", @@ -56,11 +56,11 @@ "typescript": "^5.1.6" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.2", - "@matrixai/quic-darwin-universal": "2.0.2", - "@matrixai/quic-darwin-x64": "2.0.2", - "@matrixai/quic-linux-x64": "2.0.2", - "@matrixai/quic-win32-x64": "2.0.2" + "@matrixai/quic-darwin-arm64": "2.0.3", + "@matrixai/quic-darwin-universal": "2.0.3", + "@matrixai/quic-darwin-x64": "2.0.3", + "@matrixai/quic-linux-x64": "2.0.3", + "@matrixai/quic-win32-x64": "2.0.3" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index e93f3ec2..64a02096 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/quic", - "version": "2.0.2", + "version": "2.0.3", "author": "Matrix AI", "contributors": [ { @@ -62,11 +62,11 @@ "ip-num": "^1.5.0" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.2", - "@matrixai/quic-darwin-universal": "2.0.2", - "@matrixai/quic-darwin-x64": "2.0.2", - "@matrixai/quic-linux-x64": "2.0.2", - "@matrixai/quic-win32-x64": "2.0.2" + "@matrixai/quic-darwin-arm64": "2.0.3", + "@matrixai/quic-darwin-universal": "2.0.3", + "@matrixai/quic-darwin-x64": "2.0.3", + "@matrixai/quic-linux-x64": "2.0.3", + "@matrixai/quic-win32-x64": "2.0.3" }, "devDependencies": { "@fast-check/jest": "^2.1.0", From d4ce2ddf44fb1a2df70cc768ac9c3df667ebeebc Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 09:41:01 +1100 Subject: [PATCH 12/23] 2.0.4 --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 14 +++++++------- package.json | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a4c2f2ef..d4bbc6f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "quic" -version = "2.0.3" +version = "2.0.4" dependencies = [ "boring", "napi", diff --git a/Cargo.toml b/Cargo.toml index 98e3e431..8ca1b3a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quic" -version = "2.0.3" +version = "2.0.4" authors = ["Roger Qiu "] license-file = "LICENSE" edition = "2021" diff --git a/package-lock.json b/package-lock.json index 43b20930..bcb356cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/quic", - "version": "2.0.3", + "version": "2.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/quic", - "version": "2.0.3", + "version": "2.0.4", "license": "Apache-2.0", "dependencies": { "@matrixai/async-cancellable": "^2.0.1", @@ -56,11 +56,11 @@ "typescript": "^5.1.6" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.3", - "@matrixai/quic-darwin-universal": "2.0.3", - "@matrixai/quic-darwin-x64": "2.0.3", - "@matrixai/quic-linux-x64": "2.0.3", - "@matrixai/quic-win32-x64": "2.0.3" + "@matrixai/quic-darwin-arm64": "2.0.4", + "@matrixai/quic-darwin-universal": "2.0.4", + "@matrixai/quic-darwin-x64": "2.0.4", + "@matrixai/quic-linux-x64": "2.0.4", + "@matrixai/quic-win32-x64": "2.0.4" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 64a02096..dcfad432 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/quic", - "version": "2.0.3", + "version": "2.0.4", "author": "Matrix AI", "contributors": [ { @@ -62,11 +62,11 @@ "ip-num": "^1.5.0" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.3", - "@matrixai/quic-darwin-universal": "2.0.3", - "@matrixai/quic-darwin-x64": "2.0.3", - "@matrixai/quic-linux-x64": "2.0.3", - "@matrixai/quic-win32-x64": "2.0.3" + "@matrixai/quic-darwin-arm64": "2.0.4", + "@matrixai/quic-darwin-universal": "2.0.4", + "@matrixai/quic-darwin-x64": "2.0.4", + "@matrixai/quic-linux-x64": "2.0.4", + "@matrixai/quic-win32-x64": "2.0.4" }, "devDependencies": { "@fast-check/jest": "^2.1.0", From 498455a70be0627f5b14ca408c2cb95834dc5ce6 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 10:25:23 +1100 Subject: [PATCH 13/23] fix: potential fix to absolute windows paths failing in benchmarks --- benches/index.ts | 18 +++++++++++------- benches/utils.ts | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/benches/index.ts b/benches/index.ts index 5679b3ca..84eb3646 100644 --- a/benches/index.ts +++ b/benches/index.ts @@ -12,7 +12,9 @@ console.log('dirname', dirname); async function main(): Promise { console.log('mkdir', path.join(dirname, 'results')); - await fs.promises.mkdir(path.join(dirname, 'results'), { recursive: true }); + await fs.promises.mkdir(url.pathToFileURL(path.join(dirname, 'results')), { + recursive: true, + }); // Running all suites for await (const suitePath of fsWalk(suitesPath)) { // Skip over non-ts and non-js files @@ -29,18 +31,20 @@ async function main(): Promise { } // Concatenating metrics const metricsPath = path.join(resultsPath, 'metrics.txt'); - await fs.promises.rm(metricsPath, { force: true }); + await fs.promises.rm(url.pathToFileURL(metricsPath), { force: true }); let concatenating = false; for await (const metricPath of fsWalk(resultsPath)) { // Skip over non-metrics files if (!metricPath.endsWith('_metrics.txt')) { continue; } - const metricData = await fs.promises.readFile(metricPath); + const metricData = await fs.promises.readFile( + url.pathToFileURL(metricPath), + ); if (concatenating) { - await fs.promises.appendFile(metricsPath, '\n'); + await fs.promises.appendFile(url.pathToFileURL(metricsPath), '\n'); } - await fs.promises.appendFile(metricsPath, metricData); + await fs.promises.appendFile(url.pathToFileURL(metricsPath), metricData); concatenating = true; } const systemData = await si.get({ @@ -48,9 +52,9 @@ async function main(): Promise { osInfo: 'platform, distro, release, kernel, arch', system: 'model, manufacturer', }); - console.log('write file', path.join(dirname, 'results', 'system.json')) + console.log('write file', path.join(dirname, 'results', 'system.json')); await fs.promises.writeFile( - path.join(dirname, 'results', 'system.json'), + url.pathToFileURL(path.join(dirname, 'results', 'system.json')), JSON.stringify(systemData, null, 2), ); } diff --git a/benches/utils.ts b/benches/utils.ts index 03cd2453..f56a04c6 100644 --- a/benches/utils.ts +++ b/benches/utils.ts @@ -27,7 +27,9 @@ const suiteCommon = [ // To `results/path/to/suite` const resultPath = path.join(resultsPath, relativePath); // This creates directory `results/path/to` - fs.mkdirSync(path.dirname(resultPath), { recursive: true }); + fs.mkdirSync(url.pathToFileURL(path.dirname(resultPath)), { + recursive: true, + }); return relativePath; }, folder: resultsPath, @@ -41,7 +43,9 @@ const suiteCommon = [ // To `results/path/to/suite` const resultPath = path.join(resultsPath, relativePath); // This creates directory `results/path/to` - fs.mkdirSync(path.dirname(resultPath), { recursive: true }); + fs.mkdirSync(url.pathToFileURL(path.dirname(resultPath)), { + recursive: true, + }); return relativePath; }, folder: resultsPath, @@ -54,9 +58,11 @@ const suiteCommon = [ // To `results/path/to/suite_metrics.txt` const resultPath = path.join(resultsPath, relativePath) + '_metrics.txt'; // This creates directory `results/path/to` - fs.mkdirSync(path.dirname(resultPath), { recursive: true }); + fs.mkdirSync(url.pathToFileURL(path.dirname(resultPath)), { + recursive: true, + }); fs.writeFileSync( - resultPath, + url.pathToFileURL(resultPath), codeBlock` # TYPE ${summary.name}_ops gauge ${summary.results @@ -89,7 +95,9 @@ const suiteCommon = [ ]; async function* fsWalk(dir: string): AsyncGenerator { - const dirents = await fs.promises.readdir(dir, { withFileTypes: true }); + const dirents = await fs.promises.readdir(url.pathToFileURL(dir), { + withFileTypes: true, + }); for (const dirent of dirents) { const res = path.resolve(dir, dirent.name); if (dirent.isDirectory()) { From a50f993aa8bc1679f8873cbecc4ba9ff8f4f3734 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 10:35:52 +1100 Subject: [PATCH 14/23] build: more logging messages --- scripts/brew-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/brew-install.sh b/scripts/brew-install.sh index 88c9b36d..38016a77 100755 --- a/scripts/brew-install.sh +++ b/scripts/brew-install.sh @@ -20,6 +20,10 @@ brew link --overwrite rustup-init # Brew does not provide specific versions of rust # However rustup provides specific versions # Here we provide both toolchains +echo "Running rustup-init" rustup-init --default-toolchain 1.68.2 -y +echo "Adding x86_64-apple-darwin as target" rustup add x86_64-apple-darwin +echo "Adding aarch64-apple-darwin as target" rustup add aarch64-apple-darwin +echo "Completed brew setup" From 5d1ab22a4ddd163443b20aabbe2f87a851b29896 Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Thu, 27 Mar 2025 10:40:54 +1100 Subject: [PATCH 15/23] 2.0.5 --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 14 +++++++------- package.json | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4bbc6f1..47c6f600 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "quic" -version = "2.0.4" +version = "2.0.5" dependencies = [ "boring", "napi", diff --git a/Cargo.toml b/Cargo.toml index 8ca1b3a6..ab703f2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quic" -version = "2.0.4" +version = "2.0.5" authors = ["Roger Qiu "] license-file = "LICENSE" edition = "2021" diff --git a/package-lock.json b/package-lock.json index bcb356cd..d154666e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/quic", - "version": "2.0.4", + "version": "2.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/quic", - "version": "2.0.4", + "version": "2.0.5", "license": "Apache-2.0", "dependencies": { "@matrixai/async-cancellable": "^2.0.1", @@ -56,11 +56,11 @@ "typescript": "^5.1.6" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.4", - "@matrixai/quic-darwin-universal": "2.0.4", - "@matrixai/quic-darwin-x64": "2.0.4", - "@matrixai/quic-linux-x64": "2.0.4", - "@matrixai/quic-win32-x64": "2.0.4" + "@matrixai/quic-darwin-arm64": "2.0.5", + "@matrixai/quic-darwin-universal": "2.0.5", + "@matrixai/quic-darwin-x64": "2.0.5", + "@matrixai/quic-linux-x64": "2.0.5", + "@matrixai/quic-win32-x64": "2.0.5" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index dcfad432..91cc8562 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/quic", - "version": "2.0.4", + "version": "2.0.5", "author": "Matrix AI", "contributors": [ { @@ -62,11 +62,11 @@ "ip-num": "^1.5.0" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.4", - "@matrixai/quic-darwin-universal": "2.0.4", - "@matrixai/quic-darwin-x64": "2.0.4", - "@matrixai/quic-linux-x64": "2.0.4", - "@matrixai/quic-win32-x64": "2.0.4" + "@matrixai/quic-darwin-arm64": "2.0.5", + "@matrixai/quic-darwin-universal": "2.0.5", + "@matrixai/quic-darwin-x64": "2.0.5", + "@matrixai/quic-linux-x64": "2.0.5", + "@matrixai/quic-win32-x64": "2.0.5" }, "devDependencies": { "@fast-check/jest": "^2.1.0", From a268b8f225ef9c060a9942bc8250d256b7eb7a68 Mon Sep 17 00:00:00 2001 From: Brynley Llewellyn-Roux Date: Thu, 27 Mar 2025 10:51:53 +1100 Subject: [PATCH 16/23] fix: use `rustup toolchain add` --- scripts/brew-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/brew-install.sh b/scripts/brew-install.sh index 38016a77..1dc00152 100755 --- a/scripts/brew-install.sh +++ b/scripts/brew-install.sh @@ -23,7 +23,7 @@ brew link --overwrite rustup-init echo "Running rustup-init" rustup-init --default-toolchain 1.68.2 -y echo "Adding x86_64-apple-darwin as target" -rustup add x86_64-apple-darwin +rustup toolchain install x86_64-apple-darwin echo "Adding aarch64-apple-darwin as target" -rustup add aarch64-apple-darwin +rustup toolchain install aarch64-apple-darwin echo "Completed brew setup" From 568c9c55c673e8e6bea86974e7f87c37889b63a4 Mon Sep 17 00:00:00 2001 From: Brynley Llewellyn-Roux Date: Thu, 27 Mar 2025 10:54:56 +1100 Subject: [PATCH 17/23] 2.0.6 --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 14 +++++++------- package.json | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 47c6f600..b11e42bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "quic" -version = "2.0.5" +version = "2.0.6" dependencies = [ "boring", "napi", diff --git a/Cargo.toml b/Cargo.toml index ab703f2a..d80f400f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quic" -version = "2.0.5" +version = "2.0.6" authors = ["Roger Qiu "] license-file = "LICENSE" edition = "2021" diff --git a/package-lock.json b/package-lock.json index d154666e..7a03c0a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/quic", - "version": "2.0.5", + "version": "2.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/quic", - "version": "2.0.5", + "version": "2.0.6", "license": "Apache-2.0", "dependencies": { "@matrixai/async-cancellable": "^2.0.1", @@ -56,11 +56,11 @@ "typescript": "^5.1.6" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.5", - "@matrixai/quic-darwin-universal": "2.0.5", - "@matrixai/quic-darwin-x64": "2.0.5", - "@matrixai/quic-linux-x64": "2.0.5", - "@matrixai/quic-win32-x64": "2.0.5" + "@matrixai/quic-darwin-arm64": "2.0.6", + "@matrixai/quic-darwin-universal": "2.0.6", + "@matrixai/quic-darwin-x64": "2.0.6", + "@matrixai/quic-linux-x64": "2.0.6", + "@matrixai/quic-win32-x64": "2.0.6" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 91cc8562..55d20463 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/quic", - "version": "2.0.5", + "version": "2.0.6", "author": "Matrix AI", "contributors": [ { @@ -62,11 +62,11 @@ "ip-num": "^1.5.0" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.5", - "@matrixai/quic-darwin-universal": "2.0.5", - "@matrixai/quic-darwin-x64": "2.0.5", - "@matrixai/quic-linux-x64": "2.0.5", - "@matrixai/quic-win32-x64": "2.0.5" + "@matrixai/quic-darwin-arm64": "2.0.6", + "@matrixai/quic-darwin-universal": "2.0.6", + "@matrixai/quic-darwin-x64": "2.0.6", + "@matrixai/quic-linux-x64": "2.0.6", + "@matrixai/quic-win32-x64": "2.0.6" }, "devDependencies": { "@fast-check/jest": "^2.1.0", From 6779d0843557a13e1453e81b77cbb35cd6cd6ab3 Mon Sep 17 00:00:00 2001 From: Brynley Llewellyn-Roux Date: Thu, 27 Mar 2025 10:59:46 +1100 Subject: [PATCH 18/23] fix: specify target for rust --- flake.lock | 2 +- scripts/brew-install.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 5e86dbd2..daf92cb6 100644 --- a/flake.lock +++ b/flake.lock @@ -30,7 +30,7 @@ "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "8ab83a21276434aaf44969b8dd0bc0e65b97a240", + "rev": "e69e710edfed397959507bcee120ec8a9c7ff03e", "type": "github" } }, diff --git a/scripts/brew-install.sh b/scripts/brew-install.sh index 1dc00152..73412720 100755 --- a/scripts/brew-install.sh +++ b/scripts/brew-install.sh @@ -23,7 +23,7 @@ brew link --overwrite rustup-init echo "Running rustup-init" rustup-init --default-toolchain 1.68.2 -y echo "Adding x86_64-apple-darwin as target" -rustup toolchain install x86_64-apple-darwin +rustup target add x86_64-apple-darwin echo "Adding aarch64-apple-darwin as target" -rustup toolchain install aarch64-apple-darwin +rustup target add aarch64-apple-darwin echo "Completed brew setup" From f6d45901d52704585a6bcac984f96fa246475f62 Mon Sep 17 00:00:00 2001 From: Brynley Llewellyn-Roux Date: Thu, 27 Mar 2025 11:00:18 +1100 Subject: [PATCH 19/23] 2.0.7 --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 14 +++++++------- package.json | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b11e42bd..812c898a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "quic" -version = "2.0.6" +version = "2.0.7" dependencies = [ "boring", "napi", diff --git a/Cargo.toml b/Cargo.toml index d80f400f..126bbbad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quic" -version = "2.0.6" +version = "2.0.7" authors = ["Roger Qiu "] license-file = "LICENSE" edition = "2021" diff --git a/package-lock.json b/package-lock.json index 7a03c0a4..0898ceb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/quic", - "version": "2.0.6", + "version": "2.0.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/quic", - "version": "2.0.6", + "version": "2.0.7", "license": "Apache-2.0", "dependencies": { "@matrixai/async-cancellable": "^2.0.1", @@ -56,11 +56,11 @@ "typescript": "^5.1.6" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.6", - "@matrixai/quic-darwin-universal": "2.0.6", - "@matrixai/quic-darwin-x64": "2.0.6", - "@matrixai/quic-linux-x64": "2.0.6", - "@matrixai/quic-win32-x64": "2.0.6" + "@matrixai/quic-darwin-arm64": "2.0.7", + "@matrixai/quic-darwin-universal": "2.0.7", + "@matrixai/quic-darwin-x64": "2.0.7", + "@matrixai/quic-linux-x64": "2.0.7", + "@matrixai/quic-win32-x64": "2.0.7" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 55d20463..80350f9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/quic", - "version": "2.0.6", + "version": "2.0.7", "author": "Matrix AI", "contributors": [ { @@ -62,11 +62,11 @@ "ip-num": "^1.5.0" }, "optionalDependencies": { - "@matrixai/quic-darwin-arm64": "2.0.6", - "@matrixai/quic-darwin-universal": "2.0.6", - "@matrixai/quic-darwin-x64": "2.0.6", - "@matrixai/quic-linux-x64": "2.0.6", - "@matrixai/quic-win32-x64": "2.0.6" + "@matrixai/quic-darwin-arm64": "2.0.7", + "@matrixai/quic-darwin-universal": "2.0.7", + "@matrixai/quic-darwin-x64": "2.0.7", + "@matrixai/quic-linux-x64": "2.0.7", + "@matrixai/quic-win32-x64": "2.0.7" }, "devDependencies": { "@fast-check/jest": "^2.1.0", From c685a59dabbbf5f267404c629a05c4a916daacdf Mon Sep 17 00:00:00 2001 From: Brynley Llewellyn-Roux Date: Thu, 27 Mar 2025 11:01:23 +1100 Subject: [PATCH 20/23] fix: add concurrency group for `tag.yml` --- .github/workflows/tag.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 82fea2eb..b42f3843 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -6,6 +6,10 @@ on: - 'v*.*.*' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: use-native-library-js-tag: permissions: From 31f0117ea9c65f77d8319f725e26f099f7cfaa0c Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Fri, 28 Mar 2025 08:53:30 +1100 Subject: [PATCH 21/23] feat: updating benchmark structure --- .../{suites/buffers => }/buffer_allocation.ts | 14 +- benches/index.ts | 78 +- .../buffer_allocation.chart.html | 18 +- .../results/buffers/buffer_allocation.json | 677 ------------------ .../buffers/buffer_allocation_metrics.txt | 26 - benches/results/metrics.txt | 88 +-- .../{streams => }/stream_1KiB.chart.html | 14 +- .../{streams => }/stream_1KiB_FFI.chart.html | 14 +- benches/results/streams/stream_1KiB.json | 103 --- benches/results/streams/stream_1KiB_FFI.json | 114 --- .../streams/stream_1KiB_FFI_metrics.txt | 8 - .../results/streams/stream_1KiB_metrics.txt | 8 - benches/results/system.json | 2 +- benches/{suites/streams => }/stream_1KiB.ts | 22 +- .../{suites/streams => }/stream_1KiB_FFI.ts | 16 +- benches/utils.ts | 111 --- benches/utils/BenchHandler.ts | 15 + benches/utils/index.ts | 2 + benches/utils/utils.ts | 66 ++ 19 files changed, 217 insertions(+), 1179 deletions(-) rename benches/{suites/buffers => }/buffer_allocation.ts (73%) rename benches/results/{buffers => }/buffer_allocation.chart.html (75%) delete mode 100644 benches/results/buffers/buffer_allocation.json delete mode 100644 benches/results/buffers/buffer_allocation_metrics.txt rename benches/results/{streams => }/stream_1KiB.chart.html (89%) rename benches/results/{streams => }/stream_1KiB_FFI.chart.html (89%) delete mode 100644 benches/results/streams/stream_1KiB.json delete mode 100644 benches/results/streams/stream_1KiB_FFI.json delete mode 100644 benches/results/streams/stream_1KiB_FFI_metrics.txt delete mode 100644 benches/results/streams/stream_1KiB_metrics.txt rename benches/{suites/streams => }/stream_1KiB.ts (83%) rename benches/{suites/streams => }/stream_1KiB_FFI.ts (94%) delete mode 100644 benches/utils.ts create mode 100644 benches/utils/BenchHandler.ts create mode 100644 benches/utils/index.ts create mode 100644 benches/utils/utils.ts diff --git a/benches/suites/buffers/buffer_allocation.ts b/benches/buffer_allocation.ts similarity index 73% rename from benches/suites/buffers/buffer_allocation.ts rename to benches/buffer_allocation.ts index 317985af..13d9d7be 100644 --- a/benches/suites/buffers/buffer_allocation.ts +++ b/benches/buffer_allocation.ts @@ -1,12 +1,13 @@ +import path from 'node:path'; import url from 'node:url'; import b from 'benny'; -import { summaryName, suiteCommon } from '../../utils.js'; +import { suiteCommon } from './utils/index.js'; -const filename = url.fileURLToPath(new URL(import.meta.url)); +const filePath = url.fileURLToPath(import.meta.url); async function main() { const summary = await b.suite( - summaryName(filename), + path.basename(filePath, path.extname(filePath)), b.add('Buffer.alloc', () => { Buffer.alloc(1350); }), @@ -42,8 +43,11 @@ async function main() { return summary; } -if (process.argv[1] === url.fileURLToPath(import.meta.url)) { - void main(); +if (import.meta.url.startsWith('file:')) { + const modulePath = url.fileURLToPath(import.meta.url); + if (process.argv[1] === modulePath) { + void main(); + } } export default main; diff --git a/benches/index.ts b/benches/index.ts index 84eb3646..7ad06a28 100644 --- a/benches/index.ts +++ b/benches/index.ts @@ -1,66 +1,58 @@ -#!/usr/bin/env ts-node +#!/usr/bin/env tsx -import type { Summary } from 'benny/lib/internal/common-types.js'; -import fs from 'fs'; -import path from 'path'; +import fs from 'node:fs'; +import path from 'node:path'; import url from 'node:url'; import si from 'systeminformation'; -import { fsWalk, resultsPath, suitesPath } from './utils.js'; - -const dirname = url.fileURLToPath(new URL('.', import.meta.url)); -console.log('dirname', dirname); +import { benchesPath } from './utils/utils.js'; +import buffer_allocation from './buffer_allocation.js'; +import stream_1KiB from './stream_1KiB.js'; +import stream_1KiB_FFI from './stream_1KiB_FFI.js'; async function main(): Promise { - console.log('mkdir', path.join(dirname, 'results')); - await fs.promises.mkdir(url.pathToFileURL(path.join(dirname, 'results')), { + await fs.promises.mkdir(path.join(benchesPath, 'results'), { recursive: true, }); - // Running all suites - for await (const suitePath of fsWalk(suitesPath)) { - // Skip over non-ts and non-js files - const ext = path.extname(suitePath); - if (ext !== '.ts' && ext !== '.js') { - continue; - } - const suite: () => Promise = (await import(suitePath)).default; - // Skip default exports that are not functions and are not called "main" - // They might be utility files - if (typeof suite === 'function' && suite.name === 'main') { - await suite(); - } - } - // Concatenating metrics - const metricsPath = path.join(resultsPath, 'metrics.txt'); - await fs.promises.rm(url.pathToFileURL(metricsPath), { force: true }); + await buffer_allocation(); + await stream_1KiB(); + await stream_1KiB_FFI(); + const resultFilenames = await fs.promises.readdir( + path.join(benchesPath, 'results'), + ); + const metricsFile = await fs.promises.open( + path.join(benchesPath, 'results', 'metrics.txt'), + 'w', + ); let concatenating = false; - for await (const metricPath of fsWalk(resultsPath)) { - // Skip over non-metrics files - if (!metricPath.endsWith('_metrics.txt')) { - continue; + for (const resultFilename of resultFilenames) { + if (/.+_metrics\.txt$/.test(resultFilename)) { + const metricsData = await fs.promises.readFile( + path.join(benchesPath, 'results', resultFilename), + ); + if (concatenating) { + await metricsFile.write('\n'); + } + await metricsFile.write(metricsData); + concatenating = true; } - const metricData = await fs.promises.readFile( - url.pathToFileURL(metricPath), - ); - if (concatenating) { - await fs.promises.appendFile(url.pathToFileURL(metricsPath), '\n'); - } - await fs.promises.appendFile(url.pathToFileURL(metricsPath), metricData); - concatenating = true; } + await metricsFile.close(); const systemData = await si.get({ cpu: '*', osInfo: 'platform, distro, release, kernel, arch', system: 'model, manufacturer', }); - console.log('write file', path.join(dirname, 'results', 'system.json')); await fs.promises.writeFile( - url.pathToFileURL(path.join(dirname, 'results', 'system.json')), + path.join(benchesPath, 'results', 'system.json'), JSON.stringify(systemData, null, 2), ); } -if (process.argv[1] === url.fileURLToPath(import.meta.url)) { - void main(); +if (import.meta.url.startsWith('file:')) { + const modulePath = url.fileURLToPath(import.meta.url); + if (process.argv[1] === modulePath) { + void main(); + } } export default main; diff --git a/benches/results/buffers/buffer_allocation.chart.html b/benches/results/buffer_allocation.chart.html similarity index 75% rename from benches/results/buffers/buffer_allocation.chart.html rename to benches/results/buffer_allocation.chart.html index d4fa2ad8..881dfe8c 100644 --- a/benches/results/buffers/buffer_allocation.chart.html +++ b/benches/results/buffer_allocation.chart.html @@ -5,7 +5,7 @@ - buffers.buffer_allocation + buffer_allocation