Hi ,

I'm Writing A Routine That Will Bring some data from a remote server through (Sockets) , The Idea Is If there is NumberOf Records (e.g. : ITem data) is 7 Then I will Add each record in (Array) Then Display it to the User , But some times e.g.: the application brings (4) records out of (7) and when I ask for the fifth sometimes no response comes from the Remote server so In this case I'll display the (4) records and asks for the User that (3) more records remaining but Because no response comes I'll display (4) records only.
Lets Say That The Time Out Is (20) seconds:
const TInt KTimeOut=20000000;

The Timer Variable Is Here:
CPeriodic* iTimer;

Here Is The Operation For Bringing the data:

iTimer->Start(KTimerDelay, KTimerDelay, TCallBack(CMyClass::TimerCallBack, this));



TInt CMyClass::TimerCallBack(TAny* aParam)
{
CMyClass* self = (CMyClass*)aParam;
CAknInformationNote* informationNote = new( ELeave ) CAknInformationNote;
// call the function you need
//----------------------------------->
_LIT8(sRet,"Sql Statement %d\r\n");
TBuf8<63> BuffRetr;
//New Modification
//----------------------------------------------->
//TInt X=0;
_LIT(KHeaderFormat,"\t%S\t%S");
TBool EndRecords=self->iAppView->RecorEnded();
TBool CrReturn=self->iAppView->CarReutrn();
//if ((CrReturn != EFalse)&& (EndRecords)&& (self->CurrentRecord < (self->NumRec+1)))//----->Recived Packet Of Data
if ((CrReturn != EFalse)&& (EndRecords))//----->Recived Packet Of Data
{
//self->iAppView->ClearTextL();
HBufC* Item=HBufC::NewLC(102399);
TBool ItemBring=self->iAppView->ItemBring();//--------->To check If The ItemBring Created Or not
if (ItemBring)//--->Here We Know That The ItemBring
{
self->RturnItemName=self->iAppView->RturnItemName().AllocL();
self->ItemLocation=self->iAppView->ReturnLocation().AllocL();
//--->Here HBufC
Item->Des().Format(KItemBringFormat,self->RturnItemName,self->ItemLocation);
self->itemList->AppendL(*Item);
self->iAppView->ResetMes();
_LIT(KNoHed,"Catch Record# %d");
TBuf<40> MsdMes;
MsdMes.Format(KNoHed,self->CurrentRecord);
self->iAppView->ClearTextL();
self->iAppView->PrintNotify(_L("Please Wait..."));
informationNote->ExecuteLD(MsdMes);
if (self->CurrentRecord < self->NumRec)
{
self->CurrentRecord++;
BuffRetr.Format(sRet,self->CurrentRecord);
if (self->CurrentRecord <= self->NumRec) self->iSocketsEngine->WriteL(BuffRetr);
}
else
{
//self->NotEndOfFilling=EFalse;
self->iAppView->ClearTextL();
self->itemList->AppendL(*Item);
self->StopTimer();
self->iAppView->CreateListBoxL(self->ClientRect(),self->itemList);
}
//self->iAppView->CreateListBoxL(self->ClientRect(),self->itemList);
CleanupStack::PopAndDestroy();
}
else //ItemBring Not Created Because It Is Too Big
{
self->RturnItemName->Des().Copy(_L("Too Big Record"));
self->ItemLocation->Des().Copy(_L("Big Record"));
Item->Des().Format(KItemBringFormat,self->RturnItemName,self->ItemLocation);
self->itemList->AppendL(*Item);
}
}
//----------------------------------->
return KErrNone;
}//


I want to add statement to The Condition (if (self->CurrentRecord < self->NumRec) ) to be the same statement & (Time Out > 20 Seconds).

How I Can Add this Condition?