���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /home/real/node-v13.0.1/lib/internal/cluster/ |
'use strict'; const assert = require('internal/assert'); const dgram = require('internal/dgram'); const net = require('net'); module.exports = SharedHandle; function SharedHandle(key, address, port, addressType, fd, flags) { this.key = key; this.workers = []; this.handle = null; this.errno = 0; var rval; if (addressType === 'udp4' || addressType === 'udp6') rval = dgram._createSocketHandle(address, port, addressType, fd, flags); else rval = net._createServerHandle(address, port, addressType, fd, flags); if (typeof rval === 'number') this.errno = rval; else this.handle = rval; } SharedHandle.prototype.add = function(worker, send) { assert(!this.workers.includes(worker)); this.workers.push(worker); send(this.errno, null, this.handle); }; SharedHandle.prototype.remove = function(worker) { const index = this.workers.indexOf(worker); if (index === -1) return false; // The worker wasn't sharing this handle. this.workers.splice(index, 1); if (this.workers.length !== 0) return false; this.handle.close(); this.handle = null; return true; };