You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by DelinWorks March 31, 2022
I've set up an nginx server so I can host my login and signup system for this game and load the scores
Problem is that I've told nginx to keep the connections open for 120 seconds and it seems that whenever I send a request through my game the connection gets released and not kept alive. I've known this because chrome keeps the connection for exactly 120 secs using NetLimiter and when I inspect the game using NetLimiter the game just releases the connection as soon as the request is done
Why would I keep connections alive? it's because when you're working with multiplayer games you want to minimize the amount of tcp connections to be initialized. so that the server and the game feel fast
As you can see chrome keeps the connection alive as said in nginx config:
But the game keeps dropping the connection as soon as the request is finished:
So how would you go about implementing this in c++ ? (Keeping connections alive for later use)
I initiate connections this way
auto request = new (std::nothrow) network::HttpRequest();
request->setRequestType(network::HttpRequest::Type::GET);
request->setUrl("https://delingames.xyz/accounts/load_score.php?uid=1");
request->setResponseCallback([&](network::HttpClient* client, network::HttpResponse* response) {
if (response->isSucceed()) {
// process request from server
});
network::HttpClient::getInstance()->send(request);
The text was updated successfully, but these errors were encountered:
Discussed in #612
Originally posted by DelinWorks March 31, 2022
I've set up an nginx server so I can host my login and signup system for this game and load the scores
Problem is that I've told nginx to keep the connections open for 120 seconds and it seems that whenever I send a request through my game the connection gets released and not kept alive. I've known this because chrome keeps the connection for exactly 120 secs using NetLimiter and when I inspect the game using NetLimiter the game just releases the connection as soon as the request is done
Why would I keep connections alive? it's because when you're working with multiplayer games you want to minimize the amount of tcp connections to be initialized. so that the server and the game feel fast
As you can see chrome keeps the connection alive as said in nginx config:
But the game keeps dropping the connection as soon as the request is finished:
So how would you go about implementing this in c++ ? (Keeping connections alive for later use)
I initiate connections this way
The text was updated successfully, but these errors were encountered: