Lines Matching refs:port

224 // let s = net.connect({port: 80, host: 'google.com'}, function() {
231 // connect(port, [host], [cb])
281 // ([port][, host][...][, cb])
303 // ([port][, host][...][, cb])
304 options.port = arg0;
898 return this._getpeername().port;
920 return this._getsockname().port;
1021 function checkBindError(err, port, handle) {
1024 // will implicitly bind to a random port. Ergo, check that the socket is
1025 // bound to the expected port before calling listen() or connect().
1030 if (err === 0 && port > 0 && handle.getsockname) {
1033 if (err === 0 && port !== out.port) {
1034 debug(`checkBindError, bound to ${out.port} instead of ${port}`);
1043 self, address, port, addressType, localAddress, localPort, flags) {
1070 debug('connect: attempting to connect to %s:%d (addressType: %d)', address, port, addressType);
1076 req.port = port;
1081 err = self._handle.connect(req, address, port);
1083 err = self._handle.connect6(req, address, port);
1097 details = sockname.address + ':' + sockname.port;
1100 const ex = exceptionWithHostPort(err, 'connect', address, port, details);
1103 startPerf(self, kPerfHooksNetConnectContext, { type: 'net', name: 'connect', detail: { host: address, port } });
1122 const { localPort, port, flags } = context;
1147 debug('connect/multiple: attempting to connect to %s:%d (addressType: %d)', address, port, addressType);
1152 req.port = port;
1156 ArrayPrototypePush(self.autoSelectFamilyAttemptedAddresses, `${address}:${port}`);
1159 err = handle.connect(req, address, port);
1161 err = handle.connect6(req, address, port);
1169 details = sockname.address + ':' + sockname.port;
1172 ArrayPrototypePush(context.errors, exceptionWithHostPort(err, 'connect', address, port, details));
1199 // options.port === null will be checked later.
1200 if (options.port === undefined && options.path == null)
1201 throw new ERR_MISSING_ARGS(['options', 'port', 'path']);
1265 let { port, autoSelectFamilyAttemptTimeout, autoSelectFamily } = options;
1275 if (typeof port !== 'undefined') {
1276 if (typeof port !== 'number' && typeof port !== 'string') {
1277 throw new ERR_INVALID_ARG_TYPE('options.port',
1278 ['number', 'string'], port);
1280 validatePort(port);
1282 port |= 0;
1309 self, host, port, addressType, localAddress, localPort,
1348 port,
1377 options.port);
1384 self, ip, port, addressType, localAddress, localPort,
1391 function lookupAndConnectMultiple(self, async_id_symbol, lookup, host, options, dnsopts, port, localPort, timeout) {
1438 options.port);
1462 port,
1558 req.port,
1574 debug('connect/multiple: ignoring successful but timedout connection to %s:%s', req.address, req.port);
1591 req.port,
1607 debug('connect/multiple: ignoring successful but timedout connection to %s:%s', req.address, req.port);
1621 { type: 'net', name: 'connect', detail: { host: req.address, port: req.port } },
1629 debug('connect/multiple: connection to %s:%s timed out', req.address, req.port);
1712 function createServerHandle(address, port, addressType, fd, flags) {
1731 assert(!address && !port);
1732 } else if (port === -1 && addressType === -1) {
1745 if (address || port || isTCP) {
1749 err = handle.bind6(DEFAULT_IPV6_ADDR, port, flags);
1753 return createServerHandle(DEFAULT_IPV4_ADDR, port);
1756 err = handle.bind6(address, port, flags);
1758 err = handle.bind(address, port);
1770 function setupListenHandle(address, port, addressType, backlog, fd, flags) {
1771 debug('setupListenHandle', address, port, addressType, backlog, fd);
1784 rval = createServerHandle(DEFAULT_IPV6_ADDR, port, 6, fd, flags);
1797 rval = createServerHandle(address, port, addressType, fd, flags);
1800 const error = uvExceptionWithHostPort(rval, 'listen', address, port);
1817 const ex = uvExceptionWithHostPort(err, 'listen', address, port);
1829 this._connectionKey = addressType + ':' + address + ':' + port;
1855 function listenInCluster(server, address, port, addressType,
1865 server._listen2(address, port, addressType, backlog, fd, flags);
1871 port: port,
1882 err = checkBindError(err, port, handle);
1885 const ex = exceptionWithHostPort(err, 'bind', address, port);
1893 server._listen2(address, port, addressType, backlog, fd, flags);
1911 // (handle, backlog) or (path, backlog) or (port, backlog)
1913 toNumber(args.length > 2 && args[2]); // (port, host, backlog)
1931 // ([port][, host][, backlog][, cb]) where port is omitted,
1933 // or (options[, cb]) where options.port is explicitly set as undefined or
1934 // null, bind to an arbitrary unused port
1936 (typeof options.port === 'undefined' && 'port' in options) ||
1937 options.port === null) {
1938 options.port = 0;
1940 // ([port][, host][, backlog][, cb]) where port is specified
1941 // or (options[, cb]) where options.port is specified
1942 // or if options.port is normalized as 0 before
1944 if (typeof options.port === 'number' || typeof options.port === 'string') {
1945 validatePort(options.port, 'options.port');
1947 // start TCP server listening on host:port
1949 lookupAndListen(this, options.port | 0, options.host, backlog,
1953 listenInCluster(this, null, options.port | 0, 4,
1999 if (!(('port' in options) || ('path' in options))) {
2001 'must have the property "port" or "path"');
2007 function lookupAndListen(self, port, address, backlog, exclusive, flags) {
2014 listenInCluster(self, ip, port, addressType,
2061 data.localPort = localInfo.port;
2068 data.remotePort = remoteInfo.port;