From 71236097d0e8782988c4b26049748197d963e4f5 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 7 Jul 2020 15:08:26 -0700 Subject: [PATCH] quic: use Number() instead of bigint for QuicSocket stats PR-URL: https://github.com/nodejs/node/pull/34247 Reviewed-By: Anna Henningsen --- doc/api/quic.md | 97 ++++++++++++------- lib/internal/quic/core.js | 31 +++--- .../test-quic-maxconnectionsperhost.js | 2 +- .../test-quic-quicsocket-serverbusy.js | 2 +- test/parallel/test-quic-quicsocket.js | 33 +++---- 5 files changed, 92 insertions(+), 73 deletions(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index c33ea1c4829399..1e71654badfffb 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1319,10 +1319,7 @@ added: REPLACEME --> New instances of `QuicSocket` are created using the `net.createQuicSocket()` -method. - -Once created, a `QuicSocket` can be configured to work as both a client and a -server. +method, and can be used as both a client and a server. #### Event: `'busy'` -* Type: {bigint} +* Type: {number} -A `BigInt` representing the length of time this `QuicSocket` has been bound -to a local port. +The length of time this `QuicSocket` has been bound to a local port. + +Read-only. #### quicsocket.bytesReceived -* Type: {bigint} +* Type: {number} -A `BigInt` representing the number of bytes received by this `QuicSocket`. +The number of bytes received by this `QuicSocket`. + +Read-only. #### quicsocket.bytesSent -* Type: {bigint} +* Type: {number} + +The number of bytes sent by this `QuicSocket`. -A `BigInt` representing the number of bytes sent by this `QuicSocket`. +Read-only. #### quicsocket.clientSessions -* Type: {bigint} +* Type: {number} + +The number of client `QuicSession` instances that have been associated +with this `QuicSocket`. -A `BigInt` representing the number of client `QuicSession` instances that -have been associated with this `QuicSocket`. +Read-only. #### quicsocket.close(\[callback\]) -* Type: {bigint} +* Type: {number} + +The length of time this `QuicSocket` has been active, -A `BigInt` representing the length of time this `QuicSocket` has been active, +Read-only. #### quicsocket.endpoints -* Type: {bigint} +* Type: {number} -A `BigInt` representing the length of time this `QuicSocket` has been listening -for connections. +The length of time this `QuicSocket` has been listening for connections. + +Read-only #### quicsocket.listening -* Type: {bigint} +* Type: {number} -A `BigInt` representing the number of packets received by this `QuicSocket` that -have been ignored. +The number of packets received by this `QuicSocket` that have been ignored. + +Read-only. #### quicsocket.packetsReceived -* Type: {bigint} +* Type: {number} + +The number of packets successfully received by this `QuicSocket`. -A `BigInt` representing the number of packets successfully received by this -`QuicSocket`. +Read-only #### quicsocket.packetsSent -* Type: {bigint} +* Type: {number} + +The number of packets sent by this `QuicSocket`. -A `BigInt` representing the number of packets sent by this `QuicSocket`. +Read-only #### quicsocket.pending -* Type: {bigint} +* Type: {number} + +The number of `QuicSession` instances rejected due to server busy status. -A `BigInt` representing the number of `QuicSession` instances rejected -due to server busy status. +Read-only. #### quicsocket.serverSessions -* Type: {bigint} +* Type: {number} -A `BigInt` representing the number of server `QuicSession` instances that -have been associated with this `QuicSocket`. +The number of server `QuicSession` instances that have been associated with +this `QuicSocket`. + +Read-only. #### quicsocket.setDiagnosticPacketLoss(options) -* Type: {bigint} +* Type: {number} + +The number of stateless resets that have been sent. -A `BigInt` that represents the number of stateless resets that have been sent. +Read-only. #### quicsocket.toggleStatelessReset()