diff options
author | Andreas Madsen <amwebdk@gmail.com> | 2017-11-20 17:18:40 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-11-28 02:50:54 +0100 |
commit | b44efded8481877c1ec782112b9ae4c4fec37463 (patch) | |
tree | 7c967e36bc1d718c513965b619f65e7f4f9da95a /doc | |
parent | 91d131210c2d7887d8625d34c1008a3d423cf86b (diff) | |
download | android-node-v8-b44efded8481877c1ec782112b9ae4c4fec37463.tar.gz android-node-v8-b44efded8481877c1ec782112b9ae4c4fec37463.tar.bz2 android-node-v8-b44efded8481877c1ec782112b9ae4c4fec37463.zip |
async_wrap: add provider types for net server
Adds `TCPSERVERWRAP` and `PIPESERVERWRAP` as provider types. This
makes it possible to distinguish servers from connections.
PR-URL: https://github.com/nodejs/node/pull/17157
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/async_hooks.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 4135282081..54bae4b138 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -236,7 +236,7 @@ resource's constructor. ```text FSEVENTWRAP, FSREQWRAP, GETADDRINFOREQWRAP, GETNAMEINFOREQWRAP, HTTPPARSER, JSSTREAM, PIPECONNECTWRAP, PIPEWRAP, PROCESSWRAP, QUERYWRAP, SHUTDOWNWRAP, -SIGNALWRAP, STATWATCHER, TCPCONNECTWRAP, TCPWRAP, TIMERWRAP, TTYWRAP, +SIGNALWRAP, STATWATCHER, TCPCONNECTWRAP, TCPSERVER, TCPWRAP, TIMERWRAP, TTYWRAP, UDPSENDWRAP, UDPWRAP, WRITEWRAP, ZLIB, SSLCONNECTION, PBKDF2REQUEST, RANDOMBYTESREQUEST, TLSWRAP, Timeout, Immediate, TickObject ``` @@ -275,13 +275,13 @@ require('net').createServer((conn) => {}).listen(8080); Output when hitting the server with `nc localhost 8080`: ```console -TCPWRAP(2): trigger: 1 execution: 1 +TCPSERVERWRAP(2): trigger: 1 execution: 1 TCPWRAP(4): trigger: 2 execution: 0 ``` -The first `TCPWRAP` is the server which receives the connections. +The `TCPSERVERWRAP` is the server which receives the connections. -The second `TCPWRAP` is the new connection from the client. When a new +The `TCPWRAP` is the new connection from the client. When a new connection is made the `TCPWrap` instance is immediately constructed. This happens outside of any JavaScript stack (side note: a `executionAsyncId()` of `0` means it's being executed from C++, with no JavaScript stack above it). @@ -354,7 +354,7 @@ require('net').createServer(() => {}).listen(8080, () => { Output from only starting the server: ```console -TCPWRAP(2): trigger: 1 execution: 1 +TCPSERVERWRAP(2): trigger: 1 execution: 1 TickObject(3): trigger: 2 execution: 1 before: 3 Timeout(4): trigger: 3 execution: 3 @@ -387,7 +387,7 @@ Only using `execution` to graph resource allocation results in the following: TTYWRAP(6) -> Timeout(4) -> TIMERWRAP(5) -> TickObject(3) -> root(1) ``` -The `TCPWRAP` is not part of this graph, even though it was the reason for +The `TCPSERVERWRAP` is not part of this graph, even though it was the reason for `console.log()` being called. This is because binding to a port without a hostname is a *synchronous* operation, but to maintain a completely asynchronous API the user's callback is placed in a `process.nextTick()`. |