mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 05:41:13 +00:00

The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
21 lines
570 B
JavaScript
21 lines
570 B
JavaScript
var common = require('../common');
|
|
var assert = require('assert');
|
|
var net = require('net');
|
|
|
|
var server = net.createServer(function(socket) {
|
|
console.log(socket.remotePort);
|
|
assert.strictEqual(socket.remotePort, common.PORT + 1);
|
|
socket.end();
|
|
socket.on('close', function() {
|
|
server.close();
|
|
});
|
|
}).listen(common.PORT).on('listening', function() {
|
|
var client = net.connect({
|
|
host: '127.0.0.1',
|
|
port: common.PORT,
|
|
localPort: common.PORT + 1,
|
|
}).on('connect', function() {
|
|
assert.strictEqual(client.localPort, common.PORT + 1);
|
|
});
|
|
})
|