Alter the way that the NXDN Network is opened for IPv4 and IPv6.

This commit is contained in:
Jonathan Naylor 2020-11-05 09:49:36 +00:00
parent 6671e87173
commit 75cefde80a
2 changed files with 10 additions and 5 deletions

View File

@ -43,11 +43,16 @@ bool CNXDNNetwork::open()
{
LogInfo("Opening NXDN network connection");
bool ret = m_socket.open(0, PF_INET, "", m_port);
if (!ret)
return false;
unsigned int index = 0U;
return m_socket.open(1, PF_INET6, "", m_port);
bool ret1 = m_socket.open(index, PF_INET, "", m_port);
if (ret1)
index++;
bool ret2 = m_socket.open(index, PF_INET6, "", m_port);
// We're OK as long as we have either IPv4 or IPv6 or both.
return ret1 || ret2;
}
bool CNXDNNetwork::writeData(const unsigned char* data, unsigned int length, unsigned short srcId, unsigned short dstId, bool grp, const sockaddr_storage& addr, unsigned int addrLen)

View File

@ -19,6 +19,6 @@
#if !defined(VERSION_H)
#define VERSION_H
const char* VERSION = "20201104";
const char* VERSION = "20201105";
#endif