MCPcopy Index your code
hub / github.com/nodejs/node / bindServerHandle

Function bindServerHandle

lib/dgram.js:261–282  ·  view source on GitHub ↗
(self, options, errCb)

Source from the content-addressed store, hash-verified

259
260// Query primary process to get the server handle and utilize it.
261function bindServerHandle(self, options, errCb) {
262 const cluster = lazyLoadCluster();
263
264 const state = self[kStateSymbol];
265 cluster._getServer(self, options, (err, handle) => {
266 if (err) {
267 // Do not call callback if socket is closed
268 if (state.handle) {
269 errCb(err);
270 }
271 return;
272 }
273
274 if (!state.handle) {
275 // Handle has been closed in the mean time.
276 return handle.close();
277 }
278
279 replaceHandle(self, handle);
280 startListening(self);
281 });
282}
283
284Socket.prototype.bind = function(port_, address_ /* , callback */) {
285 let port = port_;

Callers 1

dgram.jsFile · 0.85

Calls 4

lazyLoadClusterFunction · 0.85
replaceHandleFunction · 0.85
startListeningFunction · 0.85
closeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…