(self, options, errCb)
| 259 | |
| 260 | // Query primary process to get the server handle and utilize it. |
| 261 | function 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 | |
| 284 | Socket.prototype.bind = function(port_, address_ /* , callback */) { |
| 285 | let port = port_; |
no test coverage detected
searching dependent graphs…