FIX DMRNewtork infinite failure on domain name resolve

This commit is contained in:
Shawn Chain
2018-07-03 11:35:55 +08:00
parent 1ab0610543
commit 1b7abded67
2 changed files with 6 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ const unsigned int HOMEBREW_DATA_PACKET_LENGTH = 55U;
CDMRNetwork::CDMRNetwork(const std::string& address, unsigned int port, unsigned int local, unsigned int id, const std::string& password, bool duplex, const char* version, bool debug, bool slot1, bool slot2, HW_TYPE hwType) :
m_addressStr(address),
m_address(),
m_port(port),
m_id(NULL),
@@ -122,7 +123,10 @@ void CDMRNetwork::setConfig(const std::string& callsign, unsigned int rxFrequenc
bool CDMRNetwork::open()
{
LogMessage("DMR, Opening DMR Network");
if (m_address.s_addr == INADDR_NONE)
{
m_address = CUDPSocket::lookup(m_addressStr);
}
m_status = WAITING_CONNECT;
m_timeoutTimer.stop();
m_retryTimer.start();

View File

@@ -57,6 +57,7 @@ public:
void close();
private:
std::string m_addressStr;
in_addr m_address;
unsigned int m_port;
uint8_t* m_id;