Skip to content
Snippets Groups Projects
Commit fa80db89 authored by Saif Eddine Askri's avatar Saif Eddine Askri
Browse files

Rename project to "Key Value Store Server" and optimize response handling in client processing

parent b6c6cc9d
No related branches found
No related tags found
No related merge requests found
# DataTransfer 📄🚀 # Key Value Store Server 📄🚀
A simple C++ program for **efficient block-wise reading of large files** and outputting their content to standard output. A simple C++ program for **efficient block-wise reading of large files** and outputting their content to standard output.
It utilizes `fread` to read data in configurable block sizes, which can be set via command-line arguments. It utilizes `fread` to read data in configurable block sizes, which can be set via command-line arguments.
......
...@@ -220,6 +220,7 @@ std::string processRequest_shared_mtx(const std::string& request) { ...@@ -220,6 +220,7 @@ std::string processRequest_shared_mtx(const std::string& request) {
void handle_client(int client_socket) { void handle_client(int client_socket) {
std::string response;
while (true) { // warte bis der Client die Verbindung trennt while (true) { // warte bis der Client die Verbindung trennt
...@@ -242,7 +243,6 @@ void handle_client(int client_socket) { ...@@ -242,7 +243,6 @@ void handle_client(int client_socket) {
body_length = static_cast<int>(body_lenght_byte); body_length = static_cast<int>(body_lenght_byte);
std::string response;
if (body_length != 0) { if (body_length != 0) {
bytes_received = 0; bytes_received = 0;
...@@ -263,7 +263,7 @@ void handle_client(int client_socket) { ...@@ -263,7 +263,7 @@ void handle_client(int client_socket) {
// Anfragezähler inkrementieren // Anfragezähler inkrementieren
request_count.fetch_add(1, std::memory_order_relaxed); request_count.fetch_add(1, std::memory_order_relaxed);
send(client_socket, response.c_str(), response.size(), 0); send(client_socket, response.c_str(), response.size(), MSG_ZEROCOPY);
} }
close(client_socket); close(client_socket);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment