-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error Too many open files #2890
Comments
should I call "socket.close" after "socket.shutdown"? socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
socket_.close(); |
It is hard to tell what could be wrong with the provided code sample. What happens inside |
void HttpServer::CloseOne()
{
if (count_ > maxConnections_) {
count_--;
cv.notify_one();
} else {
count_--;
}
} there are totally 1319 client connections, but i set single thread to accept. |
|
the keypoint headerCb = std::bind(&ClientConnection::ParserChunkHeader, self, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3);
bodyCb = std::bind(&ClientConnection::ParserChunkBody, self, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3);
p_->on_chunk_header(headerCb);
p_->on_chunk_body(bodyCb);
void ClientConnection::Close()
{
// Send a TCP shutdown
boost::beast::error_code ec;
socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ec);
// At this point the connection is closed gracefully
headerCb = nullptr;
bodyCb = nullptr;
} in funcation |
My codes:
print so many error:
![image](https://private-user-images.githubusercontent.com/21019320/341707717-bd2db91b-c8cc-4865-88a7-94d5701f6f48.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA2MjM0NDMsIm5iZiI6MTcyMDYyMzE0MywicGF0aCI6Ii8yMTAxOTMyMC8zNDE3MDc3MTctYmQyZGI5MWItYzhjYy00ODY1LTg4YTctOTRkNTcwMWY2ZjQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEwVDE0NTIyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZjYTcxOTM0MmNiNDVhYTBiNWQ2N2NmZTE2YTg3MjQwNWNkNjFmOThjOGI4Zjc3Y2IzYTZiZWNkNjI1NDNhNjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.OuQV4tmOEnt-oSrhyuI4Pn4odwcfCIjHoRfq7soXZBw)
In my server connection
Is that something wrong with "socket_.shutdown" ?
The text was updated successfully, but these errors were encountered: