Home > Software engineering >  After CHttpConnection connected domain, if domain IP changes, the same process cannot update IP
After CHttpConnection connected domain, if domain IP changes, the same process cannot update IP

Time:11-02

After CHttpConnection connected domain, if domain IP changes, the same process cannot update IP

For example, www.abc.com is the first time you open 111.111.111.111
To 222.22.22.22 behind, and the program will not automatically update

CodePudding user response:

Local DNS cache problem, clear up can

Stripped the ipconfig inside the realization method of dynamic tuning dnsapi. DLL
DnsFlushResolverCache ()

CodePudding user response:

reference 1st floor wangningyu response:
local DNS cache problem, clear up can

Stripped the ipconfig inside the realization method of dynamic tuning dnsapi. DLL
DnsFlushResolverCache ()

CodePudding user response:

reference 1st floor wangningyu response:
local DNS cache problem, clear up can

Stripped the ipconfig inside the realization method of dynamic tuning dnsapi. DLL
DnsFlushResolverCache ()


I tried this, invalid,

BOOL __stdcall DnsFlushResolverCache ()
{
BOOL bRet=FALSE;

Typedef BOOL (PfuncDnsFlushResolverCache WINAPI *) (VOID);
HMODULE hDnsModule=LoadLibrary (_T (" dnsapi. DLL "));
If (hDnsModule!=NULL)
{
PfuncDnsFlushResolverCache pFlushFun=GetProcAddress call (hDnsModule, "DnsFlushResolverCache");
If (pFlushFun!=NULL)
{
PFlushFun ();
BRet=TRUE;
}

FreeLibrary (hDnsModule);
}

Return bRet.
}

CodePudding user response:

reference jhdalhero reply: 3/f
Quote: refer to 1st floor wangningyu response:

Local DNS cache problem, clear up can

Stripped the ipconfig inside the realization method of dynamic tuning dnsapi. DLL
DnsFlushResolverCache ()


I tried this, invalid,

BOOL __stdcall DnsFlushResolverCache ()
{
BOOL bRet=FALSE;

Typedef BOOL (PfuncDnsFlushResolverCache WINAPI *) (VOID);
HMODULE hDnsModule=LoadLibrary (_T (" dnsapi. DLL "));
If (hDnsModule!=NULL)
{
PfuncDnsFlushResolverCache pFlushFun=GetProcAddress call (hDnsModule, "DnsFlushResolverCache");
If (pFlushFun!=NULL)
{
PFlushFun ();
BRet=TRUE;
}

FreeLibrary (hDnsModule);
}

Return bRet.
}


DnsFlushResolverCache returns TRUE or?

This just refresh local cache, as well as the domain, on the other side of the cache time, proposed to accelerate the resolution services, such as, speed is faster

CodePudding user response:

Feel it is better to use LibCurl directly
  • Related