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 — test: add test for socket.end callback · nodejs/node@4093572

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-net-socket-end-callback.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-net-socket-end-callback.js‎

Copy file name to clipboard
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const net = require('net');
5+
6+
const server = net.createServer((socket) => {
7+
socket.resume();
8+
}).unref();
9+
10+
server.listen(common.mustCall(() => {
11+
const connect = (...args) => {
12+
const socket = net.createConnection(server.address().port, () => {
13+
socket.end(...args);
14+
});
15+
};
16+
17+
const cb = common.mustCall(() => {}, 3);
18+
19+
connect(cb);
20+
connect('foo', cb);
21+
connect('foo', 'utf8', cb);
22+
}));

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.