(address, port, addressType, fd, flags)
| 61 | |
| 62 | |
| 63 | function _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 | |
| 87 | module.exports = { |
no test coverage detected
searching dependent graphs…