i/o timeout when binding to a local IP address
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
So I'm binding a local IP address to use in a http request.
This is the code I'm using:
localAddr, err := net.ResolveIPAddr("ip6", laddr)
if err != nil {
log.Fatal(err)
}
localTCPAddr := net.TCPAddr{
IP: localAddr.IP,
}
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
LocalAddr: &localTCPAddr,
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
},
}
This will panic with a i/o timeout. I'm not sure why this is happening as this code was working yesterday. The only reason I can think of is that I added several thousand IP addresses to a network interface, could this be causing the timeout, and does anyone know any solutions?
EDIT:
Error message:
Get https://myip.addr.space: dial tcp [myip]:0->[2607:5300:203:118:1:0:3:8b50]:443: i/o timeout
go networking ipv6
add a comment |
So I'm binding a local IP address to use in a http request.
This is the code I'm using:
localAddr, err := net.ResolveIPAddr("ip6", laddr)
if err != nil {
log.Fatal(err)
}
localTCPAddr := net.TCPAddr{
IP: localAddr.IP,
}
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
LocalAddr: &localTCPAddr,
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
},
}
This will panic with a i/o timeout. I'm not sure why this is happening as this code was working yesterday. The only reason I can think of is that I added several thousand IP addresses to a network interface, could this be causing the timeout, and does anyone know any solutions?
EDIT:
Error message:
Get https://myip.addr.space: dial tcp [myip]:0->[2607:5300:203:118:1:0:3:8b50]:443: i/o timeout
go networking ipv6
3
What is the exact error message that you get? and what is laddr?
– W.K.S
Nov 29 '18 at 10:33
@W.K.S I added the error message to the post. laddr is a valid ipv6 IP.
– robert
Nov 29 '18 at 16:00
Are you trying to source from a link-local address?
– Ron Maupin
Nov 29 '18 at 16:03
@RonMaupin The IP is part of a subnet that was routed to my vps. I'm experiencing this error after adding 1000s of ips to a network interface so I could bind to them.
– robert
Nov 29 '18 at 16:05
add a comment |
So I'm binding a local IP address to use in a http request.
This is the code I'm using:
localAddr, err := net.ResolveIPAddr("ip6", laddr)
if err != nil {
log.Fatal(err)
}
localTCPAddr := net.TCPAddr{
IP: localAddr.IP,
}
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
LocalAddr: &localTCPAddr,
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
},
}
This will panic with a i/o timeout. I'm not sure why this is happening as this code was working yesterday. The only reason I can think of is that I added several thousand IP addresses to a network interface, could this be causing the timeout, and does anyone know any solutions?
EDIT:
Error message:
Get https://myip.addr.space: dial tcp [myip]:0->[2607:5300:203:118:1:0:3:8b50]:443: i/o timeout
go networking ipv6
So I'm binding a local IP address to use in a http request.
This is the code I'm using:
localAddr, err := net.ResolveIPAddr("ip6", laddr)
if err != nil {
log.Fatal(err)
}
localTCPAddr := net.TCPAddr{
IP: localAddr.IP,
}
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
LocalAddr: &localTCPAddr,
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
},
}
This will panic with a i/o timeout. I'm not sure why this is happening as this code was working yesterday. The only reason I can think of is that I added several thousand IP addresses to a network interface, could this be causing the timeout, and does anyone know any solutions?
EDIT:
Error message:
Get https://myip.addr.space: dial tcp [myip]:0->[2607:5300:203:118:1:0:3:8b50]:443: i/o timeout
go networking ipv6
go networking ipv6
edited Nov 29 '18 at 16:01
robert
asked Nov 29 '18 at 6:30
robertrobert
329110
329110
3
What is the exact error message that you get? and what is laddr?
– W.K.S
Nov 29 '18 at 10:33
@W.K.S I added the error message to the post. laddr is a valid ipv6 IP.
– robert
Nov 29 '18 at 16:00
Are you trying to source from a link-local address?
– Ron Maupin
Nov 29 '18 at 16:03
@RonMaupin The IP is part of a subnet that was routed to my vps. I'm experiencing this error after adding 1000s of ips to a network interface so I could bind to them.
– robert
Nov 29 '18 at 16:05
add a comment |
3
What is the exact error message that you get? and what is laddr?
– W.K.S
Nov 29 '18 at 10:33
@W.K.S I added the error message to the post. laddr is a valid ipv6 IP.
– robert
Nov 29 '18 at 16:00
Are you trying to source from a link-local address?
– Ron Maupin
Nov 29 '18 at 16:03
@RonMaupin The IP is part of a subnet that was routed to my vps. I'm experiencing this error after adding 1000s of ips to a network interface so I could bind to them.
– robert
Nov 29 '18 at 16:05
3
3
What is the exact error message that you get? and what is laddr?
– W.K.S
Nov 29 '18 at 10:33
What is the exact error message that you get? and what is laddr?
– W.K.S
Nov 29 '18 at 10:33
@W.K.S I added the error message to the post. laddr is a valid ipv6 IP.
– robert
Nov 29 '18 at 16:00
@W.K.S I added the error message to the post. laddr is a valid ipv6 IP.
– robert
Nov 29 '18 at 16:00
Are you trying to source from a link-local address?
– Ron Maupin
Nov 29 '18 at 16:03
Are you trying to source from a link-local address?
– Ron Maupin
Nov 29 '18 at 16:03
@RonMaupin The IP is part of a subnet that was routed to my vps. I'm experiencing this error after adding 1000s of ips to a network interface so I could bind to them.
– robert
Nov 29 '18 at 16:05
@RonMaupin The IP is part of a subnet that was routed to my vps. I'm experiencing this error after adding 1000s of ips to a network interface so I could bind to them.
– robert
Nov 29 '18 at 16:05
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53533068%2fi-o-timeout-when-binding-to-a-local-ip-address%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53533068%2fi-o-timeout-when-binding-to-a-local-ip-address%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
What is the exact error message that you get? and what is laddr?
– W.K.S
Nov 29 '18 at 10:33
@W.K.S I added the error message to the post. laddr is a valid ipv6 IP.
– robert
Nov 29 '18 at 16:00
Are you trying to source from a link-local address?
– Ron Maupin
Nov 29 '18 at 16:03
@RonMaupin The IP is part of a subnet that was routed to my vps. I'm experiencing this error after adding 1000s of ips to a network interface so I could bind to them.
– robert
Nov 29 '18 at 16:05