Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
eee3d7e7
Commit
eee3d7e7
authored
Nov 21, 2019
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix remote address lookup for datagram handles
parent
78f54969
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
23 additions
and
11 deletions
+23
-11
libcaf_io/caf/io/network/acceptor_manager.hpp
libcaf_io/caf/io/network/acceptor_manager.hpp
+3
-0
libcaf_io/caf/io/network/datagram_handler.hpp
libcaf_io/caf/io/network/datagram_handler.hpp
+3
-0
libcaf_io/caf/io/network/datagram_manager.hpp
libcaf_io/caf/io/network/datagram_manager.hpp
+3
-0
libcaf_io/caf/io/network/datagram_servant_impl.hpp
libcaf_io/caf/io/network/datagram_servant_impl.hpp
+1
-1
libcaf_io/caf/io/network/manager.hpp
libcaf_io/caf/io/network/manager.hpp
+0
-3
libcaf_io/caf/io/network/stream_manager.hpp
libcaf_io/caf/io/network/stream_manager.hpp
+3
-0
libcaf_io/src/io/abstract_broker.cpp
libcaf_io/src/io/abstract_broker.cpp
+1
-1
libcaf_io/src/io/network/datagram_handler.cpp
libcaf_io/src/io/network/datagram_handler.cpp
+6
-0
libcaf_io/src/io/network/datagram_servant_impl.cpp
libcaf_io/src/io/network/datagram_servant_impl.cpp
+2
-5
libcaf_io/src/io/network/test_multiplexer.cpp
libcaf_io/src/io/network/test_multiplexer.cpp
+1
-1
No files found.
libcaf_io/caf/io/network/acceptor_manager.hpp
View file @
eee3d7e7
...
...
@@ -36,6 +36,9 @@ public:
/// Get the port of the underlying I/O device.
virtual
uint16_t
port
()
const
=
0
;
/// Get the port of the underlying I/O device.
virtual
std
::
string
addr
()
const
=
0
;
};
}
// namespace caf
...
...
libcaf_io/caf/io/network/datagram_handler.hpp
View file @
eee3d7e7
...
...
@@ -88,6 +88,9 @@ public:
/// once the stream has been started.
void
flush
(
const
manager_ptr
&
mgr
);
/// Return the remote address for a given `hdl`.
std
::
string
addr
(
datagram_handle
hdl
)
const
;
void
removed_from_loop
(
operation
op
)
override
;
void
graceful_shutdown
()
override
;
...
...
libcaf_io/caf/io/network/datagram_manager.hpp
View file @
eee3d7e7
...
...
@@ -47,6 +47,9 @@ public:
/// Get the port of the underlying I/O device.
virtual
uint16_t
port
(
datagram_handle
)
const
=
0
;
/// Get the remote address of the underlying I/O device.
virtual
std
::
string
addr
(
datagram_handle
)
const
=
0
;
};
}
// namespace caf
...
...
libcaf_io/caf/io/network/datagram_servant_impl.hpp
View file @
eee3d7e7
...
...
@@ -50,7 +50,7 @@ public:
void
flush
()
override
;
std
::
string
addr
()
const
override
;
std
::
string
addr
(
datagram_handle
hdl
)
const
override
;
uint16_t
port
(
datagram_handle
hdl
)
const
override
;
...
...
libcaf_io/caf/io/network/manager.hpp
View file @
eee3d7e7
...
...
@@ -63,9 +63,6 @@ public:
/// Detaches this manager from its parent in case of an error.
void
io_failure
(
execution_unit
*
ctx
,
operation
op
);
/// Get the address of the underlying I/O device.
virtual
std
::
string
addr
()
const
=
0
;
protected:
/// Creates a message signalizing a disconnect to the parent.
virtual
message
detach_message
()
=
0
;
...
...
libcaf_io/caf/io/network/stream_manager.hpp
View file @
eee3d7e7
...
...
@@ -40,6 +40,9 @@ public:
/// Get the port of the underlying I/O device.
virtual
uint16_t
port
()
const
=
0
;
/// Get the address of the underlying I/O device.
virtual
std
::
string
addr
()
const
=
0
;
};
}
// namespace caf
...
...
libcaf_io/src/io/abstract_broker.cpp
View file @
eee3d7e7
...
...
@@ -317,7 +317,7 @@ datagram_handle abstract_broker::datagram_hdl_by_port(uint16_t port) {
std
::
string
abstract_broker
::
remote_addr
(
datagram_handle
hdl
)
{
auto
i
=
datagram_servants_
.
find
(
hdl
);
return
i
!=
datagram_servants_
.
end
()
?
i
->
second
->
addr
()
:
std
::
string
{};
return
i
!=
datagram_servants_
.
end
()
?
i
->
second
->
addr
(
hdl
)
:
std
::
string
{};
}
uint16_t
abstract_broker
::
remote_port
(
datagram_handle
hdl
)
{
...
...
libcaf_io/src/io/network/datagram_handler.cpp
View file @
eee3d7e7
...
...
@@ -122,6 +122,12 @@ void datagram_handler::remove_endpoint(datagram_handle hdl) {
}
}
std
::
string
datagram_handler
::
addr
(
datagram_handle
hdl
)
const
{
if
(
auto
itr
=
ep_by_hdl_
.
find
(
hdl
);
itr
!=
ep_by_hdl_
.
end
())
return
host
(
itr
->
second
);
return
std
::
string
{};
}
void
datagram_handler
::
removed_from_loop
(
operation
op
)
{
switch
(
op
)
{
case
operation
:
:
read
:
...
...
libcaf_io/src/io/network/datagram_servant_impl.cpp
View file @
eee3d7e7
...
...
@@ -85,11 +85,8 @@ void datagram_servant_impl::flush() {
handler_
.
flush
(
this
);
}
std
::
string
datagram_servant_impl
::
addr
()
const
{
auto
x
=
remote_addr_of_fd
(
handler_
.
fd
());
if
(
!
x
)
return
""
;
return
*
x
;
std
::
string
datagram_servant_impl
::
addr
(
datagram_handle
hdl
)
const
{
return
handler_
.
addr
(
hdl
);
}
uint16_t
datagram_servant_impl
::
port
(
datagram_handle
hdl
)
const
{
...
...
libcaf_io/src/io/network/test_multiplexer.cpp
View file @
eee3d7e7
...
...
@@ -371,7 +371,7 @@ datagram_servant_ptr test_multiplexer::new_datagram_servant(datagram_handle hdl,
void
flush
()
override
{
// nop
}
std
::
string
addr
()
const
override
{
std
::
string
addr
(
datagram_handle
)
const
override
{
return
"test"
;
}
uint16_t
port
(
datagram_handle
dh
)
const
override
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment