MCPcopy Create free account
hub / github.com/cocos/cocos-engine / sendImmediate

Method sendImmediate

native/cocos/network/HttpClient-java.cpp:895–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

893}
894
895void HttpClient::sendImmediate(HttpRequest *request) {
896 if (nullptr == request) {
897 return;
898 }
899
900 request->addRef();
901 // Create a HttpResponse object, the default setting is http access failed
902 auto *response = ccnew HttpResponse(request);
903 response->addRef(); // NOTE: RefCounted object's reference count is changed to 0 now. so needs to addRef after ccnew.
904
905 gThreadPool->pushTask([this, request, response](int /*tid*/) { HttpClient::networkThreadAlone(request, response); });
906}
907
908// Poll and notify main thread if responses exists in queue
909void HttpClient::dispatchResponseCallbacks() {

Callers

nothing calls this directly

Calls 3

HttpResponseClass · 0.85
pushTaskMethod · 0.80
addRefMethod · 0.45

Tested by

no test coverage detected