Hi all,
I'm using the TIdTrivialFTP Borland TFTP Class to transfer some data from one machine to another.
I'm using the following code segment:
This works about 50% of the time. However, when it fails, it fails with an exception indicating "No route to host".
Here's the code...
//************************************
TComponent *ftpComponent = new TComponent(NULL);
TIdTrivialFTP* tftpClient;
try
{
tftpClient = new TIdTrivialFTP(ftpComponent);
tftpClient->Host = "10.10.1.10"; // Example Host
Sleep(5000U);
tftpClient->Put("C:\\MyFolder\\MyFile.exe", "File.exe");
delete tftpClient;
delete ftpComponent;
}
catch(EIdTFTPException &)
{
// Retry once
try
{
Sleep(2000U);
tftpClient->Put("C:\\MyFolder\\MyFile.exe", "File.exe");
delete tftpClient;
delete ftpComponent;
}
catch(EIdTFTPException &)
{
delete tftpClient;
delete ftpComponent;
}
}
//**************************************
Does anyone know why this would fail with "No Route To Host"?
Am I using this incorrectly?
Thanks
-Mike
I'm using the TIdTrivialFTP Borland TFTP Class to transfer some data from one machine to another.
I'm using the following code segment:
This works about 50% of the time. However, when it fails, it fails with an exception indicating "No route to host".
Here's the code...
//************************************
TComponent *ftpComponent = new TComponent(NULL);
TIdTrivialFTP* tftpClient;
try
{
tftpClient = new TIdTrivialFTP(ftpComponent);
tftpClient->Host = "10.10.1.10"; // Example Host
Sleep(5000U);
tftpClient->Put("C:\\MyFolder\\MyFile.exe", "File.exe");
delete tftpClient;
delete ftpComponent;
}
catch(EIdTFTPException &)
{
// Retry once
try
{
Sleep(2000U);
tftpClient->Put("C:\\MyFolder\\MyFile.exe", "File.exe");
delete tftpClient;
delete ftpComponent;
}
catch(EIdTFTPException &)
{
delete tftpClient;
delete ftpComponent;
}
}
//**************************************
Does anyone know why this would fail with "No Route To Host"?
Am I using this incorrectly?
Thanks
-Mike