Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dhtnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
dhtnet
Commits
5636f7cb
Commit
5636f7cb
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
MultiplexedSocket: add logger argument
Change-Id: I1c872351cf3f0e519595ab8d734db2841d7d2218
parent
6a529fb3
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/multiplexed_socket.h
+1
-1
1 addition, 1 deletion
include/multiplexed_socket.h
src/connectionmanager.cpp
+1
-1
1 addition, 1 deletion
src/connectionmanager.cpp
src/multiplexed_socket.cpp
+4
-3
4 additions, 3 deletions
src/multiplexed_socket.cpp
with
6 additions
and
5 deletions
include/multiplexed_socket.h
+
1
−
1
View file @
5636f7cb
...
@@ -79,7 +79,7 @@ struct ChannelRequest
...
@@ -79,7 +79,7 @@ struct ChannelRequest
class
MultiplexedSocket
:
public
std
::
enable_shared_from_this
<
MultiplexedSocket
>
class
MultiplexedSocket
:
public
std
::
enable_shared_from_this
<
MultiplexedSocket
>
{
{
public:
public:
MultiplexedSocket
(
std
::
shared_ptr
<
asio
::
io_context
>
ctx
,
const
DeviceId
&
deviceId
,
std
::
unique_ptr
<
TlsSocketEndpoint
>
endpoint
);
MultiplexedSocket
(
std
::
shared_ptr
<
asio
::
io_context
>
ctx
,
const
DeviceId
&
deviceId
,
std
::
unique_ptr
<
TlsSocketEndpoint
>
endpoint
,
std
::
shared_ptr
<
dht
::
log
::
Logger
>
logger
=
{}
);
~
MultiplexedSocket
();
~
MultiplexedSocket
();
std
::
shared_ptr
<
ChannelSocket
>
addChannel
(
const
std
::
string
&
name
);
std
::
shared_ptr
<
ChannelSocket
>
addChannel
(
const
std
::
string
&
name
);
...
...
This diff is collapsed.
Click to expand it.
src/connectionmanager.cpp
+
1
−
1
View file @
5636f7cb
...
@@ -1256,7 +1256,7 @@ ConnectionManager::Impl::onDhtPeerRequest(const PeerConnectionRequest& req,
...
@@ -1256,7 +1256,7 @@ ConnectionManager::Impl::onDhtPeerRequest(const PeerConnectionRequest& req,
void
void
ConnectionManager
::
Impl
::
addNewMultiplexedSocket
(
const
CallbackId
&
id
,
const
std
::
shared_ptr
<
ConnectionInfo
>&
info
)
ConnectionManager
::
Impl
::
addNewMultiplexedSocket
(
const
CallbackId
&
id
,
const
std
::
shared_ptr
<
ConnectionInfo
>&
info
)
{
{
info
->
socket_
=
std
::
make_shared
<
MultiplexedSocket
>
(
config_
->
ioContext
,
id
.
first
,
std
::
move
(
info
->
tls_
));
info
->
socket_
=
std
::
make_shared
<
MultiplexedSocket
>
(
config_
->
ioContext
,
id
.
first
,
std
::
move
(
info
->
tls_
)
,
config_
->
logger
);
info
->
socket_
->
setOnReady
(
info
->
socket_
->
setOnReady
(
[
w
=
weak
()](
const
DeviceId
&
deviceId
,
const
std
::
shared_ptr
<
ChannelSocket
>&
socket
)
{
[
w
=
weak
()](
const
DeviceId
&
deviceId
,
const
std
::
shared_ptr
<
ChannelSocket
>&
socket
)
{
if
(
auto
sthis
=
w
.
lock
())
if
(
auto
sthis
=
w
.
lock
())
...
...
This diff is collapsed.
Click to expand it.
src/multiplexed_socket.cpp
+
4
−
3
View file @
5636f7cb
...
@@ -60,7 +60,8 @@ public:
...
@@ -60,7 +60,8 @@ public:
Impl
(
MultiplexedSocket
&
parent
,
Impl
(
MultiplexedSocket
&
parent
,
std
::
shared_ptr
<
asio
::
io_context
>
ctx
,
std
::
shared_ptr
<
asio
::
io_context
>
ctx
,
const
DeviceId
&
deviceId
,
const
DeviceId
&
deviceId
,
std
::
unique_ptr
<
TlsSocketEndpoint
>
endpoint
)
std
::
unique_ptr
<
TlsSocketEndpoint
>
endpoint
,
std
::
shared_ptr
<
dht
::
log
::
Logger
>
logger
)
:
parent_
(
parent
)
:
parent_
(
parent
)
,
ctx_
(
std
::
move
(
ctx
))
,
ctx_
(
std
::
move
(
ctx
))
,
deviceId
(
deviceId
)
,
deviceId
(
deviceId
)
...
@@ -541,8 +542,8 @@ MultiplexedSocket::Impl::handleProtocolPacket(std::vector<uint8_t>&& pkt)
...
@@ -541,8 +542,8 @@ MultiplexedSocket::Impl::handleProtocolPacket(std::vector<uint8_t>&& pkt)
}
}
MultiplexedSocket
::
MultiplexedSocket
(
std
::
shared_ptr
<
asio
::
io_context
>
ctx
,
const
DeviceId
&
deviceId
,
MultiplexedSocket
::
MultiplexedSocket
(
std
::
shared_ptr
<
asio
::
io_context
>
ctx
,
const
DeviceId
&
deviceId
,
std
::
unique_ptr
<
TlsSocketEndpoint
>
endpoint
)
std
::
unique_ptr
<
TlsSocketEndpoint
>
endpoint
,
std
::
shared_ptr
<
dht
::
log
::
Logger
>
logger
)
:
pimpl_
(
std
::
make_unique
<
Impl
>
(
*
this
,
ctx
,
deviceId
,
std
::
move
(
endpoint
)))
:
pimpl_
(
std
::
make_unique
<
Impl
>
(
*
this
,
ctx
,
deviceId
,
std
::
move
(
endpoint
)
,
logger
))
{}
{}
MultiplexedSocket
::~
MultiplexedSocket
()
{}
MultiplexedSocket
::~
MultiplexedSocket
()
{}
...
...
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