Edward
2005-05-05 09:28:07 UTC
Hi I'm using BITS in my program to download files. The bits code works
on most machines but fails on a certain test machine. I've traced the
problem to a neverending BG_JOB_STATE_TRANSIENT_ERROR. Calling
IBackgroundCopyJob::Resume doesn't seem to continue the download.
Here is a pseudo code of the download loop: [Note this is done on a
worker thread]
while( !m_userCancelledDownload ) {
m_downloadJob->GetState( &jobState );
if( jobState == BG_JOB_STATE_TRANSFERRED ) {
break;
}
else if( jobState == BG_JOB_STATE_TRANSIENT_ERROR ) {
m_downloadJob->Resume();
}
// handle other specific conditions
::Sleep( pollingLength );
}
That code is a stripped down version, minus all status setting code.
That code works fine except on one machine and I traced the problem
down to a jobState that was continuously returning
BG_JOB_STATE_TRANSIENT_ERROR. The machine in question is running
Win2k.sp4. Any ideas what could be wrong?
Thanks,
Edward
on most machines but fails on a certain test machine. I've traced the
problem to a neverending BG_JOB_STATE_TRANSIENT_ERROR. Calling
IBackgroundCopyJob::Resume doesn't seem to continue the download.
Here is a pseudo code of the download loop: [Note this is done on a
worker thread]
while( !m_userCancelledDownload ) {
m_downloadJob->GetState( &jobState );
if( jobState == BG_JOB_STATE_TRANSFERRED ) {
break;
}
else if( jobState == BG_JOB_STATE_TRANSIENT_ERROR ) {
m_downloadJob->Resume();
}
// handle other specific conditions
::Sleep( pollingLength );
}
That code is a stripped down version, minus all status setting code.
That code works fine except on one machine and I traced the problem
down to a jobState that was continuously returning
BG_JOB_STATE_TRANSIENT_ERROR. The machine in question is running
Win2k.sp4. Any ideas what could be wrong?
Thanks,
Edward