diff options
author | James M Snell <jasnell@gmail.com> | 2020-07-07 23:42:25 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-07-09 17:14:07 +0300 |
commit | cc89aac5f7d5443e0be9d037f067391ab144244e (patch) | |
tree | 4b62277fc22a034e6046ed4399509ad270556d64 /doc/api/quic.md | |
parent | edc71ef008cb8ac68b86da3a3df8d826aae6a249 (diff) |
quic: refactor/improve error handling for busy event
Also, change setServerBusy into a setter
PR-URL: https://github.com/nodejs/node/pull/34247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'doc/api/quic.md')
-rw-r--r-- | doc/api/quic.md | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/doc/api/quic.md b/doc/api/quic.md index 6b0f9ae41bb..a847ac621aa 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1330,8 +1330,8 @@ added: REPLACEME --> Emitted when the server busy state has been toggled using -`quicSocket.setServerBusy()`. The callback is invoked with a single -boolean argument indicating `true` if busy status is enabled, +`quicSocket.serverBusy = true | false`. The callback is invoked with a +single boolean argument indicating `true` if busy status is enabled, `false` otherwise. This event is strictly informational. ```js @@ -1346,8 +1346,8 @@ socket.on('busy', (busy) => { console.log('Server is not busy'); }); -socket.setServerBusy(true); -socket.setServerBusy(false); +socket.serverBusy = true; +socket.serverBusy = false; ``` This `'busy'` event may be emitted multiple times. @@ -1874,6 +1874,18 @@ Set to `true` if the socket is not yet bound to the local UDP port. added: REPLACEME --> +#### quicsocket.serverBusy +<!-- YAML +added: REPLACEME +--> + +* Type: {boolean} When `true`, the `QuicSocket` will reject new connections. + +Setting `quicsocket.serverBusy` to `true` will tell the `QuicSocket` +to reject all new incoming connection requests using the `SERVER_BUSY` QUIC +error code. To begin receiving connections again, disable busy mode by setting +`quicsocket.serverBusy = false`. + #### quicsocket.serverBusyCount <!-- YAML added: REPLACEME @@ -1911,19 +1923,6 @@ by artificially dropping received or transmitted packets. This method is *not* to be used in production applications. -#### quicsocket.setServerBusy(\[on\]) -<!-- YAML -added: REPLACEME ---> - -* `on` {boolean} When `true`, the `QuicSocket` will reject new connections. - **Defaults**: `true`. - -Calling `setServerBusy()` or `setServerBusy(true)` will tell the `QuicSocket` -to reject all new incoming connection requests using the `SERVER_BUSY` QUIC -error code. To begin receiving connections again, disable busy mode by calling -`setServerBusy(false)`. - #### quicsocket.statelessResetCount <!-- YAML added: REPLACEME |