GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: fix return type of setTimeout in net.Socket · nodejs/node@23e56ff

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal
    • stream_base_commons.js
  • test/parallel
    • test-net-socket-timeout.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/stream_base_commons.js‎

Copy file name to clipboardExpand all lines: lib/internal/stream_base_commons.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ function onStreamRead(arrayBuffer) {
233233

234234
function setStreamTimeout(msecs, callback) {
235235
if (this.destroyed)
236-
return;
236+
return this;
237237

238238
this.timeout = msecs;
239239

Collapse file

‎test/parallel/test-net-socket-timeout.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-socket-timeout.js
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@ for (let i = 0; i < invalidCallbacks.length; i++) {
7070
const server = net.Server();
7171
server.listen(0, common.mustCall(() => {
7272
const socket = net.createConnection(server.address().port);
73-
socket.setTimeout(1, common.mustCall(() => {
74-
socket.destroy();
75-
server.close();
76-
}));
73+
assert.strictEqual(
74+
socket.setTimeout(1, common.mustCall(() => {
75+
socket.destroy();
76+
assert.strictEqual(socket.setTimeout(1, common.mustNotCall()), socket);
77+
server.close();
78+
})),
79+
socket
80+
);
7781
}));

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.