0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-pipe-abstract-socket.js
theanarkh 51abedecc5
net: check pipe mode and path
PR-URL: https://github.com/nodejs/node/pull/50770
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-11-21 12:21:57 +00:00

35 lines
749 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const net = require('net');
if (!common.isLinux) common.skip();
const path = '\0abstract';
const message = /can not set readableAll or writableAllt to true when path is abstract unix socket/;
assert.throws(() => {
const server = net.createServer(common.mustNotCall());
server.listen({
path,
readableAll: true
});
}, message);
assert.throws(() => {
const server = net.createServer(common.mustNotCall());
server.listen({
path,
writableAll: true
});
}, message);
assert.throws(() => {
const server = net.createServer(common.mustNotCall());
server.listen({
path,
readableAll: true,
writableAll: true
});
}, message);