Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

retry with family=0 when family=6,4 throws ENOTFOUND #439

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions lib/connection/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,20 @@ function connect(options, callback) {
if (err) {
makeConnection(4, options, (err, ipv4Socket) => {
if (err) {
callback(err, ipv4Socket); // in the error case, `ipv4Socket` is the originating error event name
return;
makeConnection(0, options, (err, ipDefaultSocket) => {
if (err) {
callback(err, ipDefaultSocket)
return
}

performInitialHandshake(
new Connection(ipDefaultSocket, options),
options,
callback
)
})

return
}

performInitialHandshake(new Connection(ipv4Socket, options), options, callback);
Expand Down