axmolengine / axmol

Axmol Engine – A Multi-platform Engine for Desktop, XBOX (UWP) and Mobile games. (A fork of Cocos2d-x-4.0)
https://axmol.dev
MIT License
922 stars 205 forks source link

Network requests failure rate is higher in yasio compared to java.net we use in cocos2dx #1931

Closed battulasaivinesh closed 3 months ago

battulasaivinesh commented 5 months ago

After monitoring HTTP calls from our app, we observed that the failure rate of HTTP calls is double in axmol compared to cocos2dx 3.17. Here is the list of requests with different internal response codes -

Screenshot 2024-05-26 at 6 34 39 PM

Error rate added comes up to 6% of total requests, where as before in cocos 2dx 3.17 it used to be on 3% of total requests. The first one is considered as success.

Here is a sample code on how we are doing HTTP calls from our app -

network::HttpRequest* request = new network::HttpRequest();
request->setUrl(url);
request->setRequestType(network::HttpRequest::Type::POST);
request->setResponseCallback(
    [](network::HttpClient* client, network::HttpResponse* response) { callback() });
std::string userGetStr = JsonController::getJsonStringFromValueMap(payload);
request->setRequestData(userGetStr.c_str(), userGetStr.length());
network::HttpClient::getInstance()->send(request);
CC_SAFE_RELEASE(request);
stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

smilediver commented 3 months ago

Maybe this is related to #2067. We had an issue where Axmol would flood the server with requests and it would start refusing connections.