Can't bind FHttpRequestProgressDelegate

David Evans
Tue, 10 Mar 2015 16:27:31 +0000
Multiplayer & Networking

Hi,

I’m having trouble binding FHttpRequestProgressDelegate. My code simply won’t compile, and the error message simply says there’s a linking error.

The code in question is below:

// connects to the server
void ALevelController::connect(FString serverLoc, int32 port)
{

// creates the request to be sent
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
Request->SetVerb("GET");
Request->SetURL(FString("http://localhost:8080/join_server/1"));
Request->OnRequestProgress().BindUFunction(this, &ALevelController::handleData);
Request->ProcessRequest();
FHttpRequestProgressDelegate

}

// handles data being receieved
void handleData(FHttpRequestPtr request, int32 data)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT(“Got data”));
}

It will compile with no problem if you remove this line:
Request->OnRequestProgress().BindUFunction(this, &ALevelController::handleData);

But I have no idea as to what the problem is.

Could anyone help?

Thanks in advance,
David

3 posts - 1 participant