Issue#18: force family hint for TCP getaddr

dev
Tom Early 1 year ago
parent f81f61986b
commit 71a52482f6

@ -71,7 +71,7 @@ bool CTCPReaderWriterClient::Open()
struct addrinfo hints;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC;
hints.ai_family = m_family;
hints.ai_socktype = SOCK_STREAM;
//hints.ai_flags = AI_PASSIVE;
hints.ai_protocol = IPPROTO_TCP;

@ -73,8 +73,13 @@ void IRCClient::Entry()
if (timer == 0)
{
timer = 30;
int fam = AF_UNSPEC;
if (0 == strcmp(host_name, "ircv4.openquad.net"))
fam = AF_INET;
else if (0 == strcmp(host_name, "ircv6.openquad.net"))
fam = AF_INET6;
if (! ircSock.Open(host_name, AF_UNSPEC, std::to_string(port)))
if (! ircSock.Open(host_name, fam, std::to_string(port)))
{
state = 4;
timer = 0;

Loading…
Cancel
Save

Powered by TurnKey Linux.