mirror of
https://github.com/ShaYmez/P25Clients.git
synced 2024-11-22 04:11:39 -05:00
Alter the way that the P25 Network is opened for IPv4 and IPv6.
This commit is contained in:
parent
14da695e8e
commit
99b3c15b33
@ -43,11 +43,16 @@ bool CP25Network::open()
|
|||||||
{
|
{
|
||||||
LogInfo("Opening P25 network connection");
|
LogInfo("Opening P25 network connection");
|
||||||
|
|
||||||
bool ret = m_socket.open(0, PF_INET, "", m_port);
|
unsigned int index = 0U;
|
||||||
if (!ret)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
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 CP25Network::write(const unsigned char* data, unsigned int length, const sockaddr_storage& addr, unsigned int addrLen)
|
bool CP25Network::write(const unsigned char* data, unsigned int length, const sockaddr_storage& addr, unsigned int addrLen)
|
||||||
|
@ -19,6 +19,6 @@
|
|||||||
#if !defined(VERSION_H)
|
#if !defined(VERSION_H)
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
const char* VERSION = "20201104";
|
const char* VERSION = "20201105";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user