remove getLocalAddress()
It was used for NXDNKenwoodNetwork.cpp to creates SSRC. currently SSRC uses random value, this function is no longer used.
This commit is contained in:
parent
dfaedb450b
commit
4217ccebc4
|
@ -258,31 +258,3 @@ void CUDPSocket::close()
|
|||
::close(m_fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned long CUDPSocket::getLocalAddress() const
|
||||
{
|
||||
unsigned long address = 0UL;
|
||||
|
||||
char hostname[80U];
|
||||
int ret = ::gethostname(hostname, 80);
|
||||
if (ret == -1)
|
||||
return 0UL;
|
||||
|
||||
struct hostent* phe = ::gethostbyname(hostname);
|
||||
if (phe == NULL)
|
||||
return 0UL;
|
||||
|
||||
if (phe->h_addrtype != AF_INET)
|
||||
return 0UL;
|
||||
|
||||
for (unsigned int i = 0U; phe->h_addr_list[i] != NULL; i++) {
|
||||
struct in_addr addr;
|
||||
::memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr));
|
||||
if (addr.s_addr != INADDR_LOOPBACK) {
|
||||
address = addr.s_addr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return address;
|
||||
}
|
||||
|
|
|
@ -47,8 +47,6 @@ public:
|
|||
|
||||
void close();
|
||||
|
||||
unsigned long getLocalAddress() const;
|
||||
|
||||
static in_addr lookup(const std::string& hostName);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue