elnormous/HTTPRequest

An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was ful

Opened this issue · 0 comments

Im using this header to send a request to my flask (python) hosted webserver, but after alot of requests, i got this error in my flask console:
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
which is can be solve immediately after i close my c++ program that requesting to the flask server and doesnt need to restart my webserver, which is lead to assumption its a error from my c++ program. The server and the c++ program are run on the same
server,same machine.

my code in c++ are simple just this

try {
		http::Request request{ "http://xxx.xxx.xxx.xxx:5000/gg" };
		// send a get request
		const auto response =
			request.send("GET", "", {}, std::chrono::milliseconds{ 30000 });
		result = string{ response.body.begin(), response.body.end() };
		

	}
	catch (const exception& e) {
		cout << "Request failed, error: " << e.what() << '\n';
	}
	```

I have read [this solution](https://stackoverflow.com/questions/17167977/httpwebrequest-issue-system-lacked-sufficient-buffer-space-or-because-a-queue-w), which it said should be enable keep alive, im not sure what is the correct solution and how to solve this issue.