Compiler error on Rama's tutorial

I’m following this tutorial (Rama’s TCP Socket Listener) and I’ve encountered the following compiler error:

error C2664: ‘void FTimerManager::SetTimer(FTimerHandle &,float,bool,float)’: cannot convert argument 1 from 'AYourClass *const ’ to ‘FTimerHandle &’

I didn’t change anything from the tutorial (except moving the code in Laaaaaauuuunch function to BeginPlay function; I even named the class YourClass just like in the tutorial.

Just in case, I’m using VS 2013 and UE 4.10.3.

Any help appreciated, thanks in advance.

Hi,

The tutorial is out-of-date. The first parameter should be an FTimerHandle object which you should retain in order to identify your timer in future calls:

FTimerHandle MyHandle;

// Sets MyHandle
TimerManager->SetTimer(MyHandle, MyObj, MyDelegate, MyRate);
...
// Replaces your previous timer with a new one
TimerManager->SetTimer(MyHandle, MyObj2, MyDelegate2, MyRate2);
...
// Clears your timer
TimerManager->ClearTimer(MyHandle);

Steve

Thanks Steve! In case anyone else runs into a similar problem, the documentation here has more details and a useful example