mirror of
https://github.com/ShaYmez/NXDNClients.git
synced 2024-11-22 07:24:49 -05:00
IPv6 fixes.
This commit is contained in:
parent
7c318ca402
commit
f7ef0bbb25
@ -2,7 +2,7 @@ CC = cc
|
||||
CXX = c++
|
||||
|
||||
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||
CFLAGS = -g -O3 -Wall -DHAVE_LOG_H -std=c++0x -pthread
|
||||
CFLAGS = -g -O3 -Wall -DHAVE_LOG_H -DUDP_SOCKET_MAX=2 -std=c++0x -pthread
|
||||
LIBS = -lpthread
|
||||
|
||||
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||
|
@ -87,7 +87,7 @@
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>HAVE_LOG_H;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>HAVE_LOG_H;UDP_SOCKET_MAX=2;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@ -101,7 +101,7 @@
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>HAVE_LOG_H;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>HAVE_LOG_H;UDP_SOCKET_MAX=2;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@ -117,7 +117,7 @@
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>HAVE_LOG_H;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>HAVE_LOG_H;UDP_SOCKET_MAX=2;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@ -135,7 +135,7 @@
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>HAVE_LOG_H;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>HAVE_LOG_H;UDP_SOCKET_MAX=2;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -26,9 +26,12 @@
|
||||
|
||||
CNXDNNetwork::CNXDNNetwork(unsigned int port, const std::string& callsign, bool debug) :
|
||||
m_callsign(callsign),
|
||||
m_socket(port),
|
||||
m_socket(),
|
||||
m_port(port),
|
||||
m_debug(debug)
|
||||
{
|
||||
assert(port > 0U);
|
||||
|
||||
m_callsign.resize(10U, ' ');
|
||||
}
|
||||
|
||||
@ -40,7 +43,11 @@ bool CNXDNNetwork::open()
|
||||
{
|
||||
LogInfo("Opening NXDN network connection");
|
||||
|
||||
return m_socket.open();
|
||||
bool ret = m_socket.open(0, PF_INET, "", m_port);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
return m_socket.open(1, PF_INET6, "", m_port);
|
||||
}
|
||||
|
||||
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)
|
||||
|
@ -42,9 +42,10 @@ public:
|
||||
void close();
|
||||
|
||||
private:
|
||||
std::string m_callsign;
|
||||
CUDPSocket m_socket;
|
||||
bool m_debug;
|
||||
std::string m_callsign;
|
||||
CUDPSocket m_socket;
|
||||
unsigned int m_port;
|
||||
bool m_debug;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -19,6 +19,6 @@
|
||||
#if !defined(VERSION_H)
|
||||
#define VERSION_H
|
||||
|
||||
const char* VERSION = "20201102";
|
||||
const char* VERSION = "20201104";
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user