diff --git a/doc/api/quic.md b/doc/api/quic.md index d8a65e7910..5392309594 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -107,7 +107,7 @@ const { createSocket } = require('quic'); // Create a QuicSocket associated with localhost and port 1234 const socket = createSocket({ port: 1234 }); -const client = client.connect({ +const client = socket.connect({ address: 'example.com', port: 4567, alpn: 'foo' @@ -131,7 +131,7 @@ New instance of `QuicServerSession` are created internally by the `QuicSocket` if it has been configured to listen for new connections using the `listen()` method. -``` +```js const key = getTLSKeySomehow(); const cert = getTLSCertSomehow(); @@ -405,7 +405,6 @@ added: REPLACEME An object containing the local address information for the `QuicSocket` to which the `QuicSession` is currently associated. - #### quicsession.alpnProtocol + +* Type: {BigInt} + +A `BigInt` representing the total number of times the `QuicSession` has +been blocked from sending stream data due to flow control. + +Such blocks indicate that transmitted stream data is not being consumed +quickly enough by the connected peer. + #### quicsession.bytesInFlight + +* Type: {BigInt} + +A `BitInt` representing the length of time this `QuicSocket` has been bound +to a local port. + +#### quicsocket.bytesReceived + + +* Type: {BigInt} + +A `BitInt` representing the number of bytes received by this `QuicSocket`. + +#### quicsocket.bytesSent + + +* Type: {BigInt} + +A `BitInt` representing the number of bytes sent by this `QuicSocket`. + +#### quicsocket.clientSessions + + +* Type: {BigInt} + +A `BitInt` representing the number of client `QuicSession` instances that +have been associated with this `QuicSocket`. + #### quicsocket.close([callback]) + +* Type: {BigInt} + +A `BitInt` representing the length of time this `QuicSocket` has been active, + #### quicsocket.fd + +* Type: {BigInt} + +A `BitInt` representing the length of time this `QuicSocket` has been listening +for connections. + +#### quicsocket.packetsIgnored + + +* Type: {BigInt} + +A `BitInt` representing the number of packets received by this `QuicSocket` that +have been ignored. + +#### quicsocket.packetsReceived + + +* Type: {BigInt} + +A `BitInt` representing the number of packets successfully received by this +`QuicSocket`. + +#### quicsocket.packetsSent + + +* Type: {BigInt} + +A `BitInt` representing the number of packets sent by this `QuicSocket`. + #### quicsocket.pending + +* Type: {BigInt} + +A `BitInt` representing the number of server `QuicSession` instances that +have been associated with this `QuicSocket`. + +#### quicsocket.setDiagnosticPacketLoss(options) + + +* `options` {Object} + * `rx` {double} A value in the range `0.0` to `1.0` that specifies the + probability of received packet loss. + * `tx` {double} A value in the range `0.0` to `1.0` that specifies the + probability of transmitted packet loss. + +The `quicsocket.setDiagnosticPacketLoss()` method is a diagnostic only tool +that can be used to *simulate* packet loss conditions for this `QuicSocket` +by artificially dropping received or transmitted packets. + +This method is *not* to be used in production applications. + #### quicsocket.setMulticastLoopback([on]) + +* Type: {BigInt} + +A `BigInt` representing the total number of bytes received for this +`QuicStream`. + +#### quicstream.bytesSent + + +* Type: {BigInt} + +A `BigInt` representing the total number of bytes sent by this +`QuicStream`. + #### quicstream.clientInitiated TBD +#### quicstream.duration + + +* Type: {BigInt} + +A `BigInt` representing the length of time the `QuicStream` has been active. + #### quicstream.id + +* Type: {BigInt} + +A `BigInt` representing the maximum extended data offset that has been +reported to the connected peer. + #### quicstream.pending