diff --git a/TCPReaderWriterClient.cpp b/TCPReaderWriterClient.cpp index 32fae7b..dcb4c0d 100644 --- a/TCPReaderWriterClient.cpp +++ b/TCPReaderWriterClient.cpp @@ -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; diff --git a/ircddb/IRCClient.cpp b/ircddb/IRCClient.cpp index 2126ab6..55df6d8 100644 --- a/ircddb/IRCClient.cpp +++ b/ircddb/IRCClient.cpp @@ -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;