autoupgrader OnHostUnreachable event
Return to Introduction  Previous page  Next page
Applies to
auAutoUpgrader component.  

  TauAUHostUnreachableEvent = procedure(Sender: TObject; URL, Hostname: Stringof object;  
property OnHostUnreachable: TauAUHostUnreachableEvent;  

The OnHostUnreachable event occurs if the AutoUpgrader can not connect to some remote host. The unreachable host passes in Hostname parameter and full path to inaccessible file in the URL parameter.  
Possible reasons of this problem is:  
1.User currently not connected to the Internet;  
2.Requested host name is unknown. Please check spelling of domain name in the InfoFileURL property and in URLs listed in the file which contains upgrade information, or in the Files list of InfoFile structure;  
3.Remote server is down (disconnected from Internet).  
tip The AutoUpgrader have the standard dialog box, destined to notify user about this event. If you wish to show this message automatically (in native user's language, specified in Language property), set mHostUnreachable flag of ShowMessages property to True, or otherwise, set it to False if don't want to display this message.  

procedure TForm1.auAutoUpgrader1HostUnreachable(Sender: TObject;  
  URL, Hostname: string);  
  Application.MessageBox(PChar('Host http://' + Hostname + ' is unreachable.'#13#13'Please check your Internet connection and'#13'try to upgrade this software again later.'),  
                         MB_OK or MB_ICONSTOP);  

C++ Builder:
void __fastcall TForm1::auAutoUpgrader1HostUnreachable(TObject *Sender, AnsiString URL, AnsiString Hostname)  
  AnsiString Msg =   
      "Host http://" + Hostname + " is unreachable.\n\n"  
      "Please check your Internet connection and\n"  
      "try to upgrade this software again later.";  
                          MB_OK | MB_ICONSTOP);  

See also
InfoFIleURL and ShowMessages properties;  
Files property in the InfoFile structure; Info-file example;  
Hostname property of auHTTP component.