Skip to content

Conversation

@lpinca
Copy link
Member

If specified, and only when a socket is created internally, the option
will make socket.setTimeout() to be called on the created socket with
the given timeout.

This is consistent with the timeout option of net.connect() and
prevents the timeout option of the https.Agent from being ignored
when a socket is created.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

@lpinca sadly an error occured when I tried to trigger a build :(

@nodejs-github-botnodejs-github-bot added the tls Issues and PRs related to the tls subsystem. label Jan 15, 2019
doc/api/tls.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/nodejs/node/pull/25517. Just pointing it out because I know it's easy to forget.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes will do just wasn't sure what id to use before submitting.

doc/api/tls.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe hyperlink to the setTimeout docs?

If specified, and only when a socket is created internally, the option will make `socket.setTimeout()` to be called on the created socket with the given timeout. This is consistent with the `timeout` option of `net.connect()` and prevents the `timeout` option of the `https.Agent` from being ignored when a socket is created.
lookup: options.lookup
};

if(options.timeout){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typeof options.timeout === 'number' to allow setting a timeout of 0.

Copy link
MemberAuthor

@lpincalpincaJan 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 == disabled idle timeout so I'm not sure if it's very useful. I mean it's like not setting it at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, keep it as is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code for tls.connect() is identical to that in net.connect(),

node/lib/net.js

Lines 158 to 160 in 2c7f4f4

if(options.timeout){
socket.setTimeout(options.timeout);
}
, which is what I'd expect, so LGTM as is.

@lpinca
Copy link
MemberAuthor

@lpinca
Copy link
MemberAuthor

@lpinca
Copy link
MemberAuthor

Landed in aaa7547.

@lpincalpinca closed this Jan 20, 2019
@lpincalpinca deleted the add/timeout-option branch January 20, 2019 13:58
lpinca added a commit that referenced this pull request Jan 20, 2019
If specified, and only when a socket is created internally, the option will make `socket.setTimeout()` to be called on the created socket with the given timeout. This is consistent with the `timeout` option of `net.connect()` and prevents the `timeout` option of the `https.Agent` from being ignored when a socket is created. PR-URL: #25517 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
addaleax pushed a commit that referenced this pull request Jan 23, 2019
If specified, and only when a socket is created internally, the option will make `socket.setTimeout()` to be called on the created socket with the given timeout. This is consistent with the `timeout` option of `net.connect()` and prevents the `timeout` option of the `https.Agent` from being ignored when a socket is created. PR-URL: #25517 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
@addaleaxaddaleax added the semver-minor PRs that contain new features and should be released in the next minor version. label Jan 24, 2019
@MylesBorinsMylesBorins mentioned this pull request Jan 24, 2019
MylesBorins added a commit that referenced this pull request Jan 24, 2019
Notable Changes: * events: * For unhandled `error` events with an argument that is not an `Error` object, the resulting exeption will have more information about the argument. #25621 * child_process: * When the `maxBuffer` option is passed, `stdout` and `stderr` will be truncated rather than unavailable in case of an error. #24951 * policy: * Experimental support for module integrity checks through a manifest file is implemented now. #23834 * n-api: * The `napi_threadsafe_function` feature is now stable. #25556 * report: * An experimental diagnostic API for capturing process state is available as `process.report` and through command line flags. #22712 * tls: * `tls.connect()` takes a `timeout` option analogous to the `net.connect()` one. #25517 * worker: * `process.umask()` is available as a read-only function inside Worker threads now. #25526 * An `execArgv` option that supports a subset of Node.js command line options is supported now. #25467 PR-URL: #25687
MylesBorins added a commit that referenced this pull request Jan 25, 2019
Notable Changes: * events: * For unhandled `error` events with an argument that is not an `Error` object, the resulting exeption will have more information about the argument. #25621 * child_process: * When the `maxBuffer` option is passed, `stdout` and `stderr` will be truncated rather than unavailable in case of an error. #24951 * policy: * Experimental support for module integrity checks through a manifest file is implemented now. #23834 * n-api: * The `napi_threadsafe_function` feature is now stable. #25556 * report: * An experimental diagnostic API for capturing process state is available as `process.report` and through command line flags. #22712 * tls: * `tls.connect()` takes a `timeout` option analogous to the `net.connect()` one. #25517 * worker: * `process.umask()` is available as a read-only function inside Worker threads now. #25526 * An `execArgv` option that supports a subset of Node.js command line options is supported now. #25467 PR-URL: #25687
BethGriggs pushed a commit that referenced this pull request Apr 29, 2019
If specified, and only when a socket is created internally, the option will make `socket.setTimeout()` to be called on the created socket with the given timeout. This is consistent with the `timeout` option of `net.connect()` and prevents the `timeout` option of the `https.Agent` from being ignored when a socket is created. PR-URL: #25517 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
@BethGriggsBethGriggs mentioned this pull request May 1, 2019
BethGriggs pushed a commit that referenced this pull request May 10, 2019
If specified, and only when a socket is created internally, the option will make `socket.setTimeout()` to be called on the created socket with the given timeout. This is consistent with the `timeout` option of `net.connect()` and prevents the `timeout` option of the `https.Agent` from being ignored when a socket is created. PR-URL: #25517 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 16, 2019
If specified, and only when a socket is created internally, the option will make `socket.setTimeout()` to be called on the created socket with the given timeout. This is consistent with the `timeout` option of `net.connect()` and prevents the `timeout` option of the `https.Agent` from being ignored when a socket is created. PR-URL: #25517 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-minorPRs that contain new features and should be released in the next minor version.tlsIssues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@lpinca@nodejs-github-bot@sam-github@silverwind@cjihrig@BridgeAR@addaleax