Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Performance von Anwendungen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Saif Eddine Askri
Performance von Anwendungen
Commits
fa80db89
Commit
fa80db89
authored
2 months ago
by
Saif Eddine Askri
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
prak3/readme.md
+1
-1
1 addition, 1 deletion
prak3/readme.md
prak3/src/server.cpp
+2
-2
2 additions, 2 deletions
prak3/src/server.cpp
with
3 additions
and
3 deletions
prak3/readme.md
+
1
−
1
View file @
fa80db89
#
DataTransf
er 📄🚀
#
Key Value Store Serv
er 📄🚀
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.
...
...
This diff is collapsed.
Click to expand it.
prak3/src/server.cpp
+
2
−
2
View file @
fa80db89
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment