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

Method sendImmediate

native/cocos/network/HttpClient.cpp:424–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424void HttpClient::sendImmediate(HttpRequest *request) {
425 if (!request) {
426 return;
427 }
428
429 request->addRef();
430 // Create a HttpResponse object, the default setting is http access failed
431 HttpResponse *response = ccnew HttpResponse(request);
432 response->addRef(); // NOTE: RefCounted object's reference count is changed to 0 now. so needs to addRef after ccnew.
433
434 gThreadPool->pushTask([this, request, response](int /*tid*/) { HttpClient::networkThreadAlone(request, response); });
435}
436
437// Poll and notify main thread if responses exists in queue
438void HttpClient::dispatchResponseCallbacks() {

Callers 1

sendRequestMethod · 0.45

Calls 3

HttpResponseClass · 0.85
pushTaskMethod · 0.80
addRefMethod · 0.45

Tested by

no test coverage detected