Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mtxclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Nheko Reborn
mtxclient
Commits
68188721
Commit
68188721
authored
6 years ago
by
Konstantinos Sideris
Browse files
Options
Downloads
Patches
Plain Diff
Add option to shutdown connection before joining threads
parent
e45b1c85
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
include/mtxclient/http/client.hpp
+1
-1
1 addition, 1 deletion
include/mtxclient/http/client.hpp
lib/http/client.cpp
+5
-1
5 additions, 1 deletion
lib/http/client.cpp
with
6 additions
and
2 deletions
include/mtxclient/http/client.hpp
+
1
−
1
View file @
68188721
...
...
@@ -96,7 +96,7 @@ public:
Client
(
const
std
::
string
&
server
=
""
,
uint16_t
port
=
443
);
//! Wait for the client to close.
void
close
();
void
close
(
bool
force
=
false
);
//! Set the homeserver domain name.
void
set_user
(
const
mtx
::
identifiers
::
User
&
user
)
{
user_id_
=
user
;
}
//! Set the device ID.
...
...
This diff is collapsed.
Click to expand it.
lib/http/client.cpp
+
5
−
1
View file @
68188721
...
...
@@ -38,13 +38,17 @@ Client::set_server(const std::string &server)
}
void
Client
::
close
()
Client
::
close
(
bool
force
)
{
// Destroy work object. This allows the I/O thread to
// exit the event loop when there are no more pending
// asynchronous operations.
work_
.
reset
();
// We close all open connections.
if
(
force
)
shutdown
();
// Wait for the worker threads to exit.
thread_group_
.
join_all
();
}
...
...
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