(self, newHandle)
| 228 | } |
| 229 | |
| 230 | function 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 | |
| 248 | function bufferSize(self, size, buffer) { |
| 249 | if (size >>> 0 !== size) |
no test coverage detected
searching dependent graphs…