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

Function _createSocketHandle

lib/internal/dgram.js:63–84  ·  view source on GitHub ↗
(address, port, addressType, fd, flags)

Source from the content-addressed store, hash-verified

61
62
63function _createSocketHandle(address, port, addressType, fd, flags) {
64 const handle = newHandle(addressType);
65 let err;
66
67 if (isInt32(fd) && fd > 0) {
68 const type = guessHandleType(fd);
69 if (type !== 'UDP') {
70 err = UV_EINVAL;
71 } else {
72 err = handle.open(fd);
73 }
74 } else if (port || address) {
75 err = handle.bind(address, port || 0, flags);
76 }
77
78 if (err) {
79 handle.close();
80 return err;
81 }
82
83 return handle;
84}
85
86
87module.exports = {

Calls 6

newHandleFunction · 0.85
isInt32Function · 0.85
guessHandleTypeFunction · 0.85
openMethod · 0.65
closeMethod · 0.65
bindMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…