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

Function replaceHandle

lib/dgram.js:230–246  ·  view source on GitHub ↗
(self, newHandle)

Source from the content-addressed store, hash-verified

228}
229
230function replaceHandle(self, newHandle) {
231 const state = self[kStateSymbol];
232 const oldHandle = state.handle;
233 // Sync the old handle state to new handle
234 if (!oldHandle.hasRef() && typeof newHandle.unref === 'function') {
235 newHandle.unref();
236 }
237 // Set up the handle that we got from primary.
238 newHandle.lookup = oldHandle.lookup;
239 newHandle.bind = oldHandle.bind;
240 newHandle.send = oldHandle.send;
241 newHandle[owner_symbol] = self;
242
243 // Replace the existing handle by the handle we got from primary.
244 oldHandle.close();
245 state.handle = newHandle;
246}
247
248function bufferSize(self, size, buffer) {
249 if (size >>> 0 !== size)

Callers 2

bindServerHandleFunction · 0.85
dgram.jsFile · 0.85

Calls 3

closeMethod · 0.65
hasRefMethod · 0.45
unrefMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…