diff options
author | Ouyang Yadong <oyydoibh@gmail.com> | 2018-07-29 22:41:11 +0800 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2018-08-06 11:05:51 +0200 |
commit | 2bea9cefbc10ed1dd497bbae61c07d971da287dd (patch) | |
tree | 02bfcbc3fcf39fe7524f9271762617f23e107925 /doc/api/dgram.md | |
parent | 214844ea4e561b0f77e97643d28b251cdc574089 (diff) | |
download | android-node-v8-2bea9cefbc10ed1dd497bbae61c07d971da287dd.tar.gz android-node-v8-2bea9cefbc10ed1dd497bbae61c07d971da287dd.tar.bz2 android-node-v8-2bea9cefbc10ed1dd497bbae61c07d971da287dd.zip |
dgram: implement socket.bind({ fd })
dgram: Implement binding an existing `fd`. Allow pass a `fd` property
to `socket.bind()` in dgram.
src: Add `UDPWrap::Open`
PR-URL: https://github.com/nodejs/node/pull/21745
Fixes: https://github.com/nodejs/node/issues/14961
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc/api/dgram.md')
-rw-r--r-- | doc/api/dgram.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 50fd5db5a6..b9b43fcb21 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -166,6 +166,7 @@ added: v0.11.14 * `port` {integer} * `address` {string} * `exclusive` {boolean} + * `fd` {integer} * `callback` {Function} For UDP sockets, causes the `dgram.Socket` to listen for datagram @@ -177,6 +178,11 @@ system will attempt to listen on all addresses. Once binding is complete, a `'listening'` event is emitted and the optional `callback` function is called. +The `options` object may contain a `fd` property. When a `fd` greater +than `0` is set, it will wrap around an existing socket with the given +file descriptor. In this case, the properties of `port` and `address` +will be ignored. + Note that specifying both a `'listening'` event listener and passing a `callback` to the `socket.bind()` method is not harmful but not very useful. |