feature:support for connecting horizon

This commit is contained in:
Livox-SDK
2019-12-19 17:11:48 +08:00
parent da19f31bc4
commit f5eaa30bc8
+3 -1
View File
@@ -110,7 +110,8 @@ bool FindLocalIp(const struct sockaddr_in &client_addr, uint32_t &local_ip) {
IP_ADAPTER_INFO *pAdapter = reinterpret_cast<IP_ADAPTER_INFO *>(pAdapterInfo.get()); IP_ADAPTER_INFO *pAdapter = reinterpret_cast<IP_ADAPTER_INFO *>(pAdapterInfo.get());
if (NO_ERROR == dlRetVal && pAdapter != NULL) { if (NO_ERROR == dlRetVal && pAdapter != NULL) {
while (GetAdapterState(pAdapter)) { while (pAdapter != NULL) {
if (GetAdapterState(pAdapter)) {
std::string str_ip = pAdapter->IpAddressList.IpAddress.String; std::string str_ip = pAdapter->IpAddressList.IpAddress.String;
std::string str_mask = pAdapter->IpAddressList.IpMask.String; std::string str_mask = pAdapter->IpAddressList.IpMask.String;
ULONG host_ip = inet_addr(const_cast<char *>(str_ip.c_str())); ULONG host_ip = inet_addr(const_cast<char *>(str_ip.c_str()));
@@ -122,6 +123,7 @@ bool FindLocalIp(const struct sockaddr_in &client_addr, uint32_t &local_ip) {
found = true; found = true;
break; break;
} }
}
pAdapter = pAdapter->Next; pAdapter = pAdapter->Next;
} }
} }